We are learningThe format of the 1.PHP function explode is as follows:
Array explode (string separator, string string,[int limit]);
2. The separator in the parameter is a delimiter, string is the character to be split, and limit is the maximum number of elements in the returned array.
PHP function Explode specific use examples:
- php
- $ Document_root = $_server[' Document_root '];
- ?>
- <html>
- <head>
- < title > Test Explode title>
- head>
- <body>
- php
- $ Peoples = file ($DOCUMENT _root. ' /test/03/people.txt ');
- $ Count Count = count ($peoples);
- if ($count = = 0) {
- Echo ' NO peoples pending. Please try again later. ';
- }
- For ($i = 0; $i < $count; $i + +) { /c21>
- $ Line = Explode ("T", $peoples [$i]);
- Echo ' <font color=red>'. $line [0]. ' font> ';
- Echo ' <font color=blue>'. $line [1]. ' font> ';
- Echo ' <font color=green>'. $line [2]. ' font> ';
- Echo ' <BR />';
- }
- ?>
- body>
- html>
Hope that the vast number of learning enthusiasts through the PHP function explode introduced in this article, can basically understand the use of PHP function explode method.
http://www.bkjia.com/PHPjc/446337.html www.bkjia.com true http://www.bkjia.com/PHPjc/446337.html techarticle We are learning the format of the 1.PHP function explode as follows: Array explode (string separator, string string,[int limit]); 2. The separator in the parameter is the delimiter, string is the character to be split, ...