How to convert array to string in php

Using implode() function

Syntax:

implode(separator,array)

Join array elements with a string:

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

The implode() function returns a string from the elements of an array.

Add a Comment

Your email address will not be published. Required fields are marked *