Return the string content of the <note> element:
<?php
$xml = new SimpleXMLElement("<note>Hello <to>Tove</to><from>Jani</from>World!</note>");
echo $xml;
?>
Run Example »
The __toString() function returns the string content of an element.
This function returns the string content that is directly in the element - not the string content that is inside this element's children!
SimpleXMLElement::__toString()
Return Value: | The string content on success. An empty string on failure |
---|---|
PHP Version: | 5.3+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!