|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-16 06:11 UTC] chregu@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 22:00:01 2025 UTC |
Description: ------------ I create a Xml file and when i want to read some values it just return a blank value. I you do an echo to every value works fine, but when you put all togheter is when it fails The same if you read directly from a file or from a var (simplexml_load_file or simplexml_load_string) Reproduce code: --------------- <? $values = '<?xml version="1.0" encoding="ISO-8859-1" ?> <root> <nota> <url><![CDATA[opinion.php?id=16619&extra=m]]></url> <plaza>MZT</plaza> </nota> </root>'; $xml = simplexml_load_string($values); foreach ($xml->nota as $datos) { // work echo "-".$datos->plaza."-<br>"; // work echo "-".$datos->url."-<br>"; // put together $malecon_link[$datos->plaza] = $datos->url; // don't work echo "-".$malecon_link[$datos->plaza]."-<br>"; } ?> Expected result: ---------------- $malecon_link[$datos->plaza] must return the value, in this case the url Actual result: -------------- Return a blank value