-1
如何使用XML字符串來查找其某些元素值? 我用這個代碼:如何使用XML字符串在PHP中查找某些元素值?
10: $php_var = json_decode($json, 1); 11 $serializer=new XML_Serializer(); 12: if($serializer->serialize($php_var)) 13: xml_string=htmlspecialchars($serializer->getSerializedData()); 14: echo $xml_string; 15: $xml_obj = new DOMDocument(); 16: $xml_obj->loadXML($xml_string); 17: $urls=$xml_obj->getElementsByTagName('url');
但它不工作,我得到了一個警告:DOMDocument::loadXML() [domdocument.loadxml]: Start tag expected, '<' not found in Entity, line: 1 in /var/www/seo-tool/get_details.php on line 15
聞起來像無效的XML給我。提供您的`$ xml_string`請 – Gordon 2010-12-03 16:36:55
其非常大的一個 – 2010-12-03 16:52:36