Share on Google+Share on Google+

Php Array Implode

Advertisement
This section illustrates the use of PHP Array implode function.

  • implode function joins all elements of the given array into a single String variable


PHP Array Implode Function Example
<?php
    $ar1
=array("we","all","are","human beings");
    echo
"size is ".sizeof($ar1)."<br>";
    print_r($ar1);
    echo
"<br>";
    $entity
=implode($ar1);
    echo
"size is ".sizeof($entity);
    echo
"<br>".$entity;
?>

Output
size is 4
Array ( [0] => we [1] => all [2] => are [3] => human beings )
size is 1
weallarehuman beings

Advertisements

Advertisement

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

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.