GoLang SimpleXMLElement::__toString

request it (78)
GoLang replacement for PHP's SimpleXMLElement::__toString [edit | history]



Do you know a GoLang replacement for PHP's SimpleXMLElement::__toString? Write it!

PHP SimpleXMLElement::__toString

PHP original manual for SimpleXMLElement::__toString [ show | php.net ]

SimpleXMLElement::__toString

(PHP 5 >= 5.3.0, PHP 7)

SimpleXMLElement::__toStringReturns the string content

Description

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.

Parameters

This function has no parameters.

Return Values

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

Examples

Example #1 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