As we all know, both explode and split can convert strings into arrays through specific characters in php. so why are there two functions of explode and split in the same way, so what is the difference between explode and split? let's take a look at
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 =
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
At one level, the explode and split functions in php are used to split characters into arrays. However, there are still differences between explode and split, next I will introduce it to you. At one level, the explode and split functions in php are
First, the preface
This is done because the two functions are similar in that they are converting strings into groups.
Second, explode
As can be seen from the example below, the resulting array is in a corresponding order.
$pizza = "Piece1
First, preface
The reason for doing this is because the two functions are very similar in that they are converting strings into groups.
Second, explode
As can be seen from the following example, the resulting array is in the corresponding
Objective
This is done because the two functions are similar in that they are converting strings into groups.
Explode
As can be seen from the example below, the resulting array is in a corresponding order.
The code is as follows
At one level, the explode and split functions in php are used to split characters into arrays. However, there are still differences between explode and split, next I will introduce it to you.
First, let's take a look at the definitions of the two
We all know that PHP explode () function is to divide a string into arrays. This return value is an array of strings, so today we'll show you how to use the Explode function to split a string into an instance of an array!
Using the explode function
Objective
The reason for doing this is because the two functions are very similar in that they are converting strings into groups.
Explode
As can be seen from the following example, the resulting array is in the corresponding order.
$pizza =
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.