php array append

This section demonstrates the use of the append function of the php array

 
 

Share on Google+Share on Google+

php array append

Ads

This section demonstrates the use of the append function of the php array

  • append function is used to add the element in the last position of the array
  • It adds the element to the array created by the ArrayObject class


Example of PHP Array Append Function

<?php

$ar1=new ArrayObject(array("aaa","bbb","ccc"));

foreach ($ar1 as $a)

echo $a." ";

$ar1->append("ddd");

echo "<br>after appending <br> ";

foreach ($ar1 as $a)

echo $a." ";

?>

Advertisements

Ads

Posted on: October 27, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles