PHP Implode and explode

$array = array('lastname', 'email', 'phone'); 
 $comma_separated = implode(",",$array);
 echo $comma_separated; // lastname,email,phone 

 ================================================= 

 $pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; 
 $pieces = explode(" ", $pizza); 

 echo $pieces[0]; // piece1 echo $pieces[1]; // piece2

Comments

Popular posts from this blog

PHP - CURL POST