note 16131 modified in function.split by zak
| From: | zak@php.net | Date: | Wed, 17 Oct 2001 17:15:49 +0000 |
| Subject: | note 16131 modified in function.split by zak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19062@lists.php.net to get a copy of this message | ||
As noted above, the pattern used by the split() function is a POSIX-type regular expression. For
more information on how POSIX-type regular expressions work, review the following sources:
Section 7 of the regex unix man pages. If you are running a UNIX-like operating system, run the
command
% man 7 regex
to view this man page. If you are running a different type of operating system, visit Google and
query for "man regex (7)"
Dev Shed also has a basic tutorial on regular expressions
(http://www.devshed.com/Server_Side/Administration/RegExp/page1.html)
--was--
example..
$arr_var = "A|B|C|D";
$pat = "\|";
$arr_val = split ($pat1,$abc1);
echo "<br>";
while(list(,$val)=each($arr_val)) {
echo $val."<br>";
}
Check your $pat variable.
If it is a Meta-caracter.
you must write "\|" in the pattern.
Check this url [Meta-caracters]
http://www.php.net/manual/en/pcre.pattern.syntax.php
-t
http://www.php.net/manual/en/function.split.php