PHP string join() Function

4 Sept 2024 | 1 min read

PHP string join() is predefined function. It is used to return a string from the elements of an array. It is an alias of the implode() function.

Syntax:

ParameterDescriptionRequired/Optional
separatorSpecify the array elementoptional
arrayThe array to join to a stringrequired

Example 1

Output:

Hello PHP Join Function 

Example 2

Output:

Hello+PHP+Join+Function 

Example 3

Output:

Hello-PHP-Join-Function 

Example 4

Output:

1 2 3 4 5 6 7 8 9 10 

Next TopicPHP String