我正在使用 SimpleXML 来读取我的 xml 文件。当我删除我的图像标签时,它会读取信息。我的 URL 是 HTTPS,我想阅读它们。我使用了各种字符转义字符,但没有成功。
这是我很生气的简单xml:
url_xml
<?xml version="1.0" encoding="utf-8"?>
<Image>
<ImageID>https://x.ctrl.com/Image.ashx?Id=e1f47a89-c289-43e1-a2c2-0d35196a97ee&userId=7414</ImageID>
<ImageURL>https://x.ctrl.com/Image.ashx?Id=e1f47a89-c289-43e1-a2c2-0d35196a97ee&userId=7414</ImageURL>
<TempImageURL>https://x.ctrl.com/Image.ashx?Id=e1f47a89-c289-43e1-a2c2-0d35196a97ee&userId=7414</TempImageURL>
</Image>
xml php script
<?php
$xml_source='url_xml.xml';
@$xml=simplexml_load_file($xml_source);
echo $xml->getName() . "<br>";
foreach($xml->children() as $child)
{
echo $child->getName() . ": " . $child . "<br>";
}
?>
PHP错误:
Fatal error: Call to a member function getName() on a non-object in