sjgoodjob Posted January 6, 2011 Share Posted January 6, 2011 Description: ------------ Doing the following SimpleXML text comparison does not give the expected results. Reproduce code: --------------- <?php $sxe = simplexml_load_string('<root a="123" />'); echo $sxe['a']."\n"; if ($sxe['a'] == '123') { echo 'They are equal.'."\n"; } else { echo 'They are not equal.'."\n"; } ?> Expected result: ---------------- 123 They are equal. Actual result: -------------- 123 They are not equal. Link to comment https://forums.phpfreaks.com/topic/223549-some-simplexml-problem/ Share on other sites More sharing options...
salathe Posted January 6, 2011 Share Posted January 6, 2011 See Example #6 on http://php.net/simplexml.examples-basic Link to comment https://forums.phpfreaks.com/topic/223549-some-simplexml-problem/#findComment-1155599 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.