How to convert an array to string ?

Last updated 1 year, 10 months ago | 209 views 75     5

array to string

By using implode function we can convert any array to string.  In implode function first parameter is separator which specifies what to put between the array elements. Default is "" (an empty string)

 
<?php

$arr = array('Hello','World!','Beautiful','Day!');

echo implode(" ",$arr);

?>

//output

Hello World! Beautiful Day!