Open In App

PHP | XMLReader moveToNextAttribute() Function

The XMLReader::moveToNextAttribute() function is an inbuilt function in PHP which is used to move cursor to the next attribute if positioned on an attribute or moves to first attribute if positioned on an element. This function can also be used to check if attributes are there in an element or not.

Syntax:



bool XMLReader::moveToNextAttribute( void )

Parameters: This function doesn’t accept any parameters.

Return Value: This function returns TRUE on success or FALSE on failure.



Below examples illustrate the XMLReader::moveToNextAttribute() function in PHP:

Example 1:

Example 2:

Reference: https://www.php.net/manual/en/xmlreader.movetonextattribute.php


Article Tags :