PHP | ArrayIterator append() Function Last Updated : 21 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The ArrayIterator::append() function is an inbuilt function in PHP which is used to append an element into an array iterator. Syntax: void ArrayIterator::append( mixed $value ) Parameters: This function accepts single parameter $value that holds the value that need to be append. Return Value: This function does not return any value. Below programs illustrate the ArrayIterator::append() function in PHP: Program 1: php <?php // Declare an ArrayIterator $arrItr = new ArrayIterator( array('G', 'e', 'e', 'k', 's') ); // Append the element into array iterator $arrItr->append("123"); // Display the elements while($arrItr->valid()) { echo $arrItr->current(); $arrItr->next(); } ?> Output: Geeks123 Program 2: php <?php // Declare an ArrayIterator $arrItr = new ArrayIterator( array( "a" => "Geeks", "b" => "for", "c" => "Geeks" ) ); // Append the array element $arrItr->append("Computer"); $arrItr->append("Science"); $arrItr->append("Portal"); // Display the elements foreach ($arrItr as $key => $val) { echo $key . " => " . $val . "\n"; } ?> Output: a => Geeks b => for c => Geeks 0 => Computer 1 => Science 2 => Portal Reference: https://www.php.net/manual/en/arrayiterator.append.php Create Quiz Comment J jit_t Follow 0 Improve J jit_t Follow 0 Improve Article Tags : Web Technologies PHP PHP-function Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like