How to convert an array to string ?

Last updated 2 years ago | 280 views 75     5

Tags:- PHP

PHP | How to convert an array to a string?

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)


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

echo implode(" ",$arr);



Hello World! Beautiful Day!