PHP join() Function

Last Updated:

PHP join()

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

This function is an alias of implode() function.


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


join(str, arr)

Parameter Values

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

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