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,
Both the PHP strtok () function and the explode () function can be used to split a string, but there are some differences between the two, and the Strtok () function can control the rhythm of the explode (), and this article describes in detail the
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
Foreach is often used in PHP, and arrays must be used to use foreach. Therefore, in this article, we talk about arrays and foreach. Foreach is often used in PHP, and arrays must be used to use foreach. Therefore, in this article, we talk about
This article describes the use and examples of foreach in PHP, details the use of foreach, and the interested partners can refer to it.
The use of foreach is often used in PHP, and it is necessary to use a foreach array. So, in this article, we're
Explode () function introduction
The explode () function splits a string into arrays.
Syntax: Explode (separator,string,limit).
Separator, required. Specifies where to split the string.
string, required. The string to split.
Limit,
See the two functions.Implode function:Use the implode function to convert an array to a string.Explode function:Use the function explode to convert a string to an array.Example 1.Today, I saw a post in the php forum asking my friend how to convert
The use of foreach is often used in PHP, and it is necessary to use a foreach array. So, in this article, we're talking about arrays while we talk about foreach.
foreach has two types of syntax:
The first: Iterate over the given array statement
There are many ways to traverse arrays. in other languages, arrays with consecutive subscripts use for traversal. However, based on the particularity of PHP arrays, we generally use foreach and sometimes each. Foreach:
There are many ways to
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.