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

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 […]

Log4j Software Vulnerability
Read Time5 min read
13 Dec 2021
By

The Log4j Software Vulnerability Prompts an Urgent Warning by the US Government’s Cybersecurity Agency

If you have not heard of the Log4j software vulnerability, this article provides a brief background on what the Log4j […]

Read Time5 min read
31 Oct 2020
By

Why to Have a Family-like Environment at Workplace?

The family is the cornerstone for every evolution. It is the pillar that binds the individuals in a close knot […]

Lets work together
Do you have a project in mind?