I’m trying to find the content of an array on a remote server. All I can send back currently is strings (due to limitations in the PHP implementation of xmlrpc). Normally, I’d just use var_dump(), but that returns void. I’ve tried using var_export, but I get XML errors, even when I cast the result to a string.
How can I get the string representation of an array?
Use
serialize():Then use
unserialize()to get it back into an array:You can also use
json_encode()/json_decode()if you’re interested in a JSON formatted string.