How to use the PHP split () function _php Tutorial

Source: Internet
Author: User
Function prototype: Array split (String $pattern, string $string [, int $limit])

The PHP split () function returns an array of strings, each of which is $string by a regular expression $pattern as a substring of the boundary. If $limit is set, the returned array contains a maximum of $limit cells. And the last unit contains all the rest of the $string. Spliti is the ignore size version of Split. Code 6.8 is a frequently used example of a date.

PHP split () function code 6.8 split of date

 
  
  
  1. < ? PHP
  2. $ Date "08/30/2006";
  3. The delimiter can be a slash, a dot, or a horizontal line

  4. (' [/.-] ', $date);
  5. Output to a different time format

  6. $yearbr/>n ";
  7. ?>

I hope that through the code example of this PHP split () function, we can clearly understand the specific meaning of this function.


http://www.bkjia.com/PHPjc/446247.html www.bkjia.com true http://www.bkjia.com/PHPjc/446247.html techarticle function prototype: Array split (String $pattern, string $string [, int $limit]) the PHP split () function returns an array of strings, each of which is $string by regular expression $ Pattern as boundary ...

  • 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.