implode( ) function converts an array into a string by inserting a separator between each element : implode « Data Structure « PHP






implode( ) function converts an array into a string by inserting a separator between each element

 
//string implode ( string separator, array pieces )
<?
    $oz = "Lions and Tigers and Bears";
    $oz_array = explode(" and ", $oz);
    print_r($oz_array);
    $exclams = implode("! ", $oz_array);
    print_r($exclams);
?>
  
  








Related examples in the same category

1.Consider the following block of code
2.implode an array to form a string.
3.implode.php
4.Using the implode() Function
5.Making a string from an array with implode()
6.Outputting an Array As a String
7.Printing HTML table rows with implode()
8.Repackage the contents of an array into a delimited string,