Differences between PHP functions implode () and explode () _ PHP Tutorial

Source: Internet
Author: User
The implode () and explode () functions of PHP functions are different. In previous articles, we have introduced the usage of the explode () function. When we encounter the PHP function implode (), the array elements are combined into a string. Implode (separator, we have introduced the specific usage of the explode () function in previous articles. When we encounter the PHP function implode (), the array elements are combined into a string.
Implode (separator, array)
Optional. Specifies the content to be placed between array elements. The default value is "" (null string ).
Array is required. Array to be combined as a string.
Although the separator parameter is optional. However, we recommend that you use two parameters for backward compatibility.


Example of PHP function implode ()

 
  1. $ Arr = array ('hello', 'World! ', 'Beautiful', 'day! ');
  2. Echo implode ("", $ arr );
  3. ?>

Output:

Hello World! Beautiful Day!

The above code example shows the specific implementation functions of the PHP function implode.


The usage of the aggregate () function. When we encounter the PHP function implode (), the array elements are combined into a string. Implode (separator ,...

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.