ArrayObject append() function in PHP Last Updated : 22 Mar, 2019 Comments Improve Suggest changes Like Article Like Report The append() function of the ArrayObject class in PHP is used to append a given value onto an ArrayObject. The value being appended can be a single value or an array itself. Syntax: void append($value) Parameters: This function accepts a single parameter $value, representing the value to be appended. Return Value: This function does not returns any value. Below programs illustrate the above function: Program 1: php <?php // PHP function to illustrate the // append() method $arrObj = new ArrayObject(array('Geeks', 'for', 'Geeks')); $arrObj->append('welcomes you'); var_dump($arrObj); ?> Output: object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(4) { [0]=> string(5) "Geeks" [1]=> string(3) "for" [2]=> string(5) "Geeks" [3]=> string(12) "welcomes you" } } Program 2: php <?php // PHP function to illustrate the // append() method $arrObj = new ArrayObject(array('Geeks', 'for', 'Geeks')); // Appending an array $arrObj->append(array('welcomes', 'you')); var_dump($arrObj); ?> Output: object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(4) { [0]=> string(5) "Geeks" [1]=> string(3) "for" [2]=> string(5) "Geeks" [3]=> array(2) { [0]=> string(8) "welcomes" [1]=> string(3) "you" } } } Reference: http://php.net/manual/en/arrayobject.append.php Comment More infoAdvertise with us Next Article ArrayObject append() function in PHP gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-array PHP-function PHP-ArrayObject +1 More Similar Reads PHP | ArrayIterator append() Function 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 f 1 min read ArrayObject offsetSet() Function in PHP The offsetSet() function of the ArrayObject class in PHP is used to update the value present at a specific index in the ArrayObject. Syntax: void offsetSet($index, $val) Parameters: This function accepts two parameters $index and $val. This function updates the value present at the index, $index wit 1 min read ArrayObject offsetGet() Function in PHP The offsetGet() function of the ArrayObject class in PHP is used to get the value present at a specific index at the ArrayObject. Syntax: mixed offsetGet($index) Parameters: This function accepts a single parameter $index for which corresponding value will be returned. Return Value: This function re 1 min read PHP | ArrayObject count() Function The ArrayObject::count() function is an inbuilt function in PHP which is used to get the number of public properties in the ArrayObject. Syntax: int ArrayObject::count( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the number of public propertie 1 min read ArrayObject offsetUnset() Function in PHP The offsetUnset() function of the ArrayObject class in PHP is used to unset the value preset at a specific index. In other words, it is used to remove a value present at a specific index in the ArrayObject. Syntax: void offsetUnset($index) Parameters: This function accepts a single parameter $index 2 min read ArrayObject getIterator() Function in PHP The getIterator() function of the ArrayObject class in PHP is used to create an iterator from an ArrayObject instance. This iterator can be used to iterate through the array of the respective ArrayObject. Syntax: ArrayIterator getIterator() Parameters: This function does not accepts any parameters. 1 min read ArrayObject getArrayCopy() Function in PHP The getArrayCopy() function of the ArrayObject class in PHP is used to create a copy of this ArrayObject. This function returns the copy of the array present in this ArrayObject. Syntax: array getArrayCopy() Parameters: This function does not accepts any parameters. Return Value: This function retur 1 min read PHP | AppendIterator next() Function The AppendIterator::next() function is an inbuilt function in PHP which is used to move the element into the next element. Syntax: void AppendIterator::next( void ) Parameters: This function does not accept any parameters. Return Value: This function does not return any value. Below programs illustr 2 min read ArrayObject offsetExists() Function in PHP The offsetExists() function of the ArrayObject class in PHP is used to whether a given offset or index is present in the ArrayObject or not. If it is present then the function returns a boolean True value otherwise it returns False. Syntax: bool offsetExists($index) Parameters: This function accepts 2 min read ArrayObject exchangeArray() function in PHP The exchangeArray() function of the ArrayObject class in PHP is used to exchange an array from an ArrayObject. That is, it replaces existing array from an ArrayObject with a newly described array. Syntax: ArrayObject exchangeArray( $inputArray ) Parameters: This function accepts a single parameter $ 2 min read Like