The XMLReader::__toString() function is an inbuilt function in PHP which is used to get the text content that is directly in current element. This function does not return text content that is inside this element’s children.
void XMLReader::__toString( void )
Parameters: This function doesn’t accept any parameters.
Return Value: This function returns a string content on success or an empty string on failure.
Below examples illustrate the XMLReader::__toString() function in PHP:
// Empty string because text content is in a childern node not current node.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.