The segmentation of a split string string is achieved through the explode () function. The explode () function splits a string by the specified rules and returns an array of values. Its syntax is as follows: The parameter list for the explode
This example describes how PHP obtains the number of days and date arrays by month. Share to everyone for reference, as follows: function Get_day ($date) {$tem = explode ('-', $date);//cut date to get year and month $year = $tem [' 0 ']; $month =
Explode
(PHP 4, PHP 5, PHP 7)
Explode-split a string by string
explode-using one string to split another string
Descriptionarrayexplode( $delimiter, $string[, $limitPHP_INT_MAX] )//Returns an array
In php, the string is converted to the array functions explode () and implode (). In php, the most common way to convert arrays and strings is to use the explode () and implode () functions for conversion. Today, a friend asked me this question,
In PHP, the explode () function is used to cut the string into an array. The explode Array
The function of explode () is used to split another string into arrays.
For example:
String
$ Pizza = "1st 2nd 3rd 4th 5th 6th ";
After separation by
In php, the most common way to convert arrays and strings is to use the explode () and implode () functions for conversion. Today, a friend asked me this question, let me sort out and share it with you.
See the two functions.
Implode function:
Use
The explode () function works well when we need to split an array into groups based on a character or string, but do you know how explode () is working? Interception of string problems, will avoid the reallocation of space consumption, explode will
When we need to divide an array into groups according to a character or string, explode is very happy, but you know how ~explode works.
The first thing to be sure is that explode will also allocate space, no doubt.
Copy CodeThe code is as
Php uses The explode () function to split a string into an array, an explode array. Php uses The explode () function to split a string into an array. the example in this article describes how php splits a string into an array using The explode ()
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.