Working a bit with PayPal and stumbled on the NVP response. I´m used to working with JSON and XML as a response format. But have never worked with the NVP "simplified" format. Why aren´t they and others using JSON/XML instead of NVP?

A list can look like this SomeList.Item(0).name

Is there a good way to work with NVP in PHP?

Hope somebody can explain the pros with NVP over JSON and XML and a way to work with NVP in PHP. Like how to iterate through a list.

有帮助吗?

解决方案

you can use PHP's parse_str() function. It parses a string like

user=test&password=123

into a PHP array in this form:

Array
(
    [user] => test
    [password] => 123
)

其他提示

You are probably looking for the function parse_str

Here is another example I found.

Parse Paypal NVP in PHP

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top