Php implode function example

Impode is a function used  in php which is used to form a string from an element of array.

Syntax: implode(“, ”,$string);

Description:

Usually  we have comma seperated values in array. In order to form array elements into a string we use comma separator.

$string a variable which stores values in the form of array.

Example:

$array_string = array('implode', 'code', 'expertz', 'array', 'element'); 
$implode_output = implode(",", $array_string); 
echo $implode_output;

OUTPUT:

 

Category: