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
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
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
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 =
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
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
First, let's take a look at the definitions of the two methods:Function prototype: array split (string $ pattern, string $ string [, int $ limit])Function prototype: array explode (string $ separator, string $ string [, int $ limit])There is no
Split
(PHP 3, PHP 4)
Split -- use a regular expression to split a string into an array
Description
Array split (string pattern, string [, int limit])
Tip: The preg_split () function uses Perl-Compatible Regular Expression syntax, which is usually a
This article was translated from Isystemadmin, "List of Popular Scripting Languages for Linux and Windows."A system administrator with scripting Knowledge has a distinct distinction from other system administrators. A script is an art created by a
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.