Phpjoin () function, phpjoin function _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.