PHP join() Function

Last Updated:

PHP join()

The join() function joins array elements with a string.

This function is an alias of implode() function.

Example

PHP Compiler
<?php $arr = array('apple', 'banana', 'orange'); echo join("s, ", $arr); ?>

Syntax

join(str, arr)

Parameter Values

ValueTypeExplanation
str Optional Specifies a string to prepend to each element in an array.
Default value is an empty string.
arr Required Specifies an array.

Return Value

ValueExplanation
String Returns a string containing a string representation of all the array elements in the same order, with the glue string between each element.

Share this Page

Meet the Author