PHP | ArrayIterator setFlags() Function Last Updated : 24 Jun, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The ArrayIterator::setFlags() function is an inbuilt function in PHP which is used to set the behavior of flags.Syntax: void ArrayIterator::setFlags( string $flags ) Parameters: This function accepts single parameter $flags which holds the new ArrayIterator behavior.Return Value: This function does not return any value.Below programs illustrate the ArrayIterator::setFlags() function in PHP:Program 1: php <?php // Declare an ArrayIterator $arrItr = new ArrayIterator( array('G', 'e', 'e', 'k', 's') ); // Set the flags $arrItr->setFlags(ArrayIterator::STD_PROP_LIST); // Display the result var_dump($arrItr->getFlags()); ?> Output: int(1) Program 2: php <?php // Declare an ArrayIterator $arrItr = new ArrayIterator( array( "a" => "Geeks", "b" => "for", "c" => "Geeks" ) ); // Append some elements $arrItr->append("Computer"); $arrItr->append("Science"); $arrItr->append("Portal"); // Set the flags $arrItr->setFlags(ArrayIterator::ARRAY_AS_PROPS); // Get the flags var_dump($arrItr->getFlags()); ?> Output: int(2) Reference: https://www.php.net/manual/en/arrayiterator.setflags.php Comment More infoAdvertise with us Next Article PHP ArrayObject setFlags() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Iterators PHP-ArrayIterator +1 More Similar Reads PHP | ArrayIterator seek() Function The ArrayIterator::seek() function is an inbuilt function in PHP which is used to seek the position of an array iterator. Syntax: void ArrayIterator::seek( int $position ) Parameters: This function accepts single parameter $position which holds the position to seek. Return Value: This function does 1 min read PHP | ArrayIterator seek() Function The ArrayIterator::seek() function is an inbuilt function in PHP which is used to seek the position of an array iterator. Syntax: void ArrayIterator::seek( int $position ) Parameters: This function accepts single parameter $position which holds the position to seek. Return Value: This function does 1 min read PHP | ArrayIterator getFlags() Function The ArrayIterator::getFlags() function is an inbuilt function in PHP which is used to get the behavior of flags of array iterator. Syntax: int ArrayIterator::getFlags( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the behavior flags of the Array 1 min read PHP | CachingIterator setFlags() Function The CachingIterator::setFlags() function is an inbuilt function in PHP which is used to set the flags for the CachingIterator object. Syntax: void CachingIterator::setFlags( int $flags ) Parameters: This function accepts a single parameter $flags which holds the value of bitmask of the flags to set. 1 min read PHP ArrayObject setFlags() Function The ArrayObject::setFlags() function is an inbuilt function in PHP that is used to set the flag to change the behavior of the ArrayObject. Syntax: void ArrayObject::setFlags( int $flags ) Parameters: This function accepts single parameter $flags which hold the behavior of new ArrayObject. This param 2 min read PHP | ArrayIterator serialize() Function The ArrayIterator::serialize() function is an inbuilt function in PHP which is used to serialize the array iterator. Syntax: string ArrayIterator::serialize( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the serialized ArrayIterator. Below progr 1 min read Like