Phpjoin () and phpjoin functions. The phpjoin () function and the phpjoin function phpjoin () function obtain the string composed of array elements. This article introduces the usage and basic instances of the phpjoin () function, the php join () function and the phpjoin function.
The php join () function obtains a string composed of array elements. This article introduces the usage and basic instances of the php join () function to coders. For more information about coders, see.
Definition and usage
The join () function returns a string composed of array elements.
The join () function is the alias of the implode () function.
Note: The join () function accepts the order of two parameters. However, for historical reasons, explode () does not work. you must ensure that the separator parameter is prior to the string parameter.
Note: The separator parameter of the join () function is optional. However, we recommend that you use two parameters for backward compatibility.
Syntax
join(separator,array)
| Parameters |
Description |
| Separator |
Optional. Specifies the content to be placed between array elements. The default value is "" (null string ). |
| Array |
Required. Array to be combined as a string. |
Technical details
| Return value: |
Returns a string composed of array elements. |
| PHP version: |
4 + |
| Update Log: |
In PHP 4.3.0,SeparatorThe parameter is optional. |
Instance
Separate array elements with different characters:
";echo join("+",$arr)."
";echo join("-",$arr)."
";echo join("X",$arr);?>
Online operation
The http://www.bkjia.com/PHPjc/1125684.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1125684.htmlTechArticlephp join () function, phpjoin function php join () function gets a string composed of array elements. This article introduces the usage and basic instances of the php join () function to coders...