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

Related Posts

Digital Transformation in Manufacturing Industry
Read Time5 min read
13 Jun 2024
By

Digital Transformation in The Manufacturing Industry

Have you ever wondered how all the products, such as coffee mugs, tables, pens, or other products you use every […]

importance of customer journey mapping
Read Time5 min read
29 May 2024
By

Why is Customer Journey Mapping Important?

Can you track how your customers’ sentiment varies during their journey with your brand? Today’s customers are more demanding than […]

Nodejs Debugging
Read Time5 min read
12 Jun 2023
By

Efficient Debugging Techniques for Node.js Developers

From the standpoint of a coder, Node.js is one of the finest runtime platforms for JavaScript. If software development is […]

Lets work together
Do you have a project in mind?