(PHP 5 >= 5.3.0, PHP 7, PHP 8)
SimpleXMLElement::__toString — Returns the string content
Returns text content that is directly in this element. Does not return text content that is inside this element's children.
У цієї функції немає параметрів.
Returns the string content on success or an empty string on failure.
Приклад #1 Get string content
<?php
$xml = new SimpleXMLElement('<a>1 <b>2 </b>3</a>');
echo $xml;
?>
Поданий вище приклад виведе:
1 3