English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP join() Function Usage and Example

PHP String Function Manual

Syntax

join(separator, inputay))

Definition and Usage

It is an alias of implode(), which returns a string from the elements of inputay

Return Value

It returns a string from the elements of inputay.

Parameter

Serial NumberParameters and Description
1

inputay

The array to be combined into a string

2

separator

Specify the content placed between array elements. The default is "" (empty string).

Online Example

Try the following example to combine array elements into a string:

<?php
    //Use join to combine array elements into a string
   $input = array('w3codebox, '.com', 'Simply', 'Easy', 'Learning');
   
   echo join(" ", $input);
?>
Test and See‹/›

Output Result-

w3codebox .com Simply Easy Learning

PHP String Function Manual