Site icon Webuters

How to Implode Array

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

Key Concept :

Syntax :

implode(separator,array)

Separator :-  Optional. Specifies what to put between the array elements. Default is “” (an empty string).
Array  :- Required. The array to join to a string.

Example for implode() function:

<!DOCTYPE html>
<html>
<body>

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

</body>
</html>

Output : Hello World! Beautiful Day!

Thanks for reading !…..