PHP Handling Namespace with SimpleXML
问题 I really need help with using namespaces. How do I get the following code to work properly? <?php $mytv = simplexml_load_string( '<?xml version="1.0" encoding="utf-8"?> <mytv> <mytv:channelone> <mytv:description>comedy that makes you laugh</mytv:description> </mytv:channelone> </mytv>' ); foreach ($mytv as $mytv1) { echo 'description: ', $mytv1->children('mytv', true)->channelone->description; } ?> All I'm trying to do is get the content inside the name element. 回答1: when ever yu are using