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