Webuter's Technology Pvt Ltd

How to Implode Array

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

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

Key Concept :

  •  The implode() function accept its parameters in either order.
  •  The separator parameter of implode() is optional. However, it is recommended to always use two parameters for backwards compatibility.
  •  This function is binary-safe.

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 !…..

Author Profile
Author Bio

Loading...

Loading recent posts...

Loading Categories...


Lets work together
Do you have a project in mind?
Lets work together
Do you have a project in mind?