PHP explode function explained, Phpexplode function
This article reprinted address: http://www.manongjc.com/article/515.html
The PHP explode function uses one string to split the other string, and the split string is combined into an array, and the array is returned. This article introduces to you the basic syntax of the explode function and the use of examples, the need for code farmers can refer to.
Explode using one string to split another string
basic syntax for the EXPLODE function:
Array Explode string $delimiter string $string $limit ] )
The EXPLODE function returns an array of strings, each of which is a substring of string that is separated by the delimiter as a boundary point.
Explode parameter Description:
Name of parameter |
Description |
Delimiter |
Have to. Delimited characters. |
String |
Have to. The string that needs to be split. |
Limit |
Optional. If the limit parameter is set and is a positive number, the returned array contains a maximum of limit elements, and the last element will contain the remainder of the string. If the limit parameter is a negative number, all elements except the last-limit element are returned. If limit is 0, it will be treated as 1. |
Explode return value:
This function returns an array of strings, each of which is a substring of string, separated by the delimiter as a boundary point.
If delimiter is an empty string (""), Explode () returns FALSE. If the value contained in the delimiter is not found in the string and a negative limit is used, then an empty array is returned, otherwise an array containing a single element of string is returned.
Explode instances:
$pizza = "Piece1 piece2 piece3 piece4 piece5 piece6"$pieces = explode ("", $pizza echo $pieces [0]; // Piece1 Echo $pieces [1]; // Piece2?>
Run online
http://www.bkjia.com/PHPjc/1101863.html www.bkjia.com true http://www.bkjia.com/PHPjc/1101863.html techarticle php Explode function explained, Phpexplode function This article reprint address: http://www.manongjc.com/article/515.html PHP explode function uses one string to separate another string, After the split ...