__toString
返回元素的字符串内容。
__toString()
函数返回元素的字符串内容。
此函数返回元素内直接的字符串内容,而不是该元素子元素内的字符串内容!
返回 <note> 元素的字符串内容:
<?php $xml = new SimpleXMLElement("<note>Hello <to>George</to><from>John</from>World!</note>"); echo $xml; ?>
运行实例
SimpleXMLElement::__toString()