SimpleXMLElement::__toString

(No version information available, might only be in Git)
Returns the string content
public string SimpleXMLElement::__toString ( void )

Returns text content that is directly in this element. Does not return text content that is inside this element's children.

Returns:

Returns the string content on success or an empty string on failure.

Examples:
Get string content
<?php
$xml = new SimpleXMLElement('<a>1 <b>2 </b>3</a>');
echo $xml;
?>

The above example will output:

1 3
See also:

SimpleXMLElement::asXML() -

doc_php
2016-02-24 16:15:14
Comments
Leave a Comment

Please login to continue.