Implode and explode in php

In php the implode function joins the array elements with desired glue (character);
Take an example, we have array of email-ids and we want to join these ids with comma, we shall do like this.
<?php
$emails=array("abc@gmail.com","dingdong@mno.com","jkl123@xmn.in");
$str=implode(",",$emails);

echo $emails;

//output is 

abc@gmail.com,dingdong@mno.com,jkl123@xmn.in;

?>


Explode function converts string into an array by splitting string from delimiter, when it finds given delimiter in string.

<?php
$str="abc@gmail.com|dingdong@mno.com|jkl123@xmn.in";
$emails=explode("|",$str);
print_r($emails);

//output is 
Array
(
    [0] => abc@gmail.com
    [1] =>dingdong@mno.com
    [2] => jkl123@xmn.in
);

?>