Javatpoint Logo
Javatpoint Logo

PHP string Implode() Function

PHP string implode() is predefined function that is used to join array elements with a string.

Note1: This implode() function is binary-safe.

Note2: The implode() function accept its parameters in either order for consistency. So we should use documented order of arguments.

Syntax:

Parameter Description Required/Optional
separator Specify array elements. Optional
array It is used to join string. Required

Example 1

Output:

Befor using implode() function: array('Hello','PHP','Javatpoint')
After using 'implode()' function: Hello PHP Javatpoint

Example 2

Output:

Befor using implode() function: array('Hello','PHP','Javatpoint')
After using 'implode()' function: Hello+PHP+Javatpoint

Example 3

Output:

Before using implode() function: array('Hello','PHP','Javatpoint')
After using 'implode()' function: Hello-PHP-Javatpoint

Next TopicPHP String




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA