PHP | XMLReader readString() Function
The XMLReader::readString() function is an inbuilt function in PHP which is used to read the contents of the current node as a string. Difference between readString() and getInnerXml() is that the former doesn’t includes the markup but only the content for subnodes.
string XMLReader::readString( void )
Parameters: This function doesn’t accept any parameter.
Return Value: This function returns the content of the current node as a string or empty string on failure.
Below examples illustrate the XMLReader::readString() function in PHP:
Example 1: In this program, we will read the value of an element without sub-nodes.
Example : In this program, we will read the value of an element with sub-nodes.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!