As you can see below, everything go well up to uid
and pwd
elements. Suddenly swoops places with values. AM I missing something here?
Original code is from here.
CODE:
$array = array('table'=>'users', 'operation'=>'insert', 'uid'=>'yoyo', 'pwd'=>'123');
$output = serialize($array);
$xml = new SimpleXMLElement('<root/>');
array_walk_recursive(unserialize($output), array($xml, 'addChild'));
echo $xml->asXML();
RESULT:
<?xml version="1.0"?>
<root>
<users>table</users>
<insert>operation</insert>
<yoyo>uid</yoyo>
<123>pwd</123>
</root>