SimpleXMLElement::__toString

(PHP 5 >= 5.3.0, PHP 7)

SimpleXMLElement::__toStringReturns the string content

说锟斤拷

public SimpleXMLElement::__toString ( void ) : string

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.

锟斤拷锟斤拷

Example #1 Get string content

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

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

1 3

锟轿硷拷