How to convert an array to string ?

Last updated 4 years, 2 months ago | 913 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!