spliti

(PHP 4 >= 4.0.1, PHP 5)

spliti --  用正则表达式不区分大小写将字符串分割到数组中

说明

array spliti ( string pattern, string string [, int limit] )

本函数和 split() 相同,只除了在匹配字母字符时忽略大小写的区别。

参见 preg_spliti()split()explode()implode()


add a note add a note User Contributed Notes
17-Apr-2004 02:22
When using special characters such as the tab placeholder "\t" in the split function, be careful not to escape the slash by adding a slah in front of it. To signify a tab, new line or carriage return use only one slash in front of the character. For example:

$cartes= "one\ttwo\tthree";

$tab_cartes = split("\t",$cartes );

$items = count($tab_cartes);
for ($x = 0; $x < $items; $x++)
   { echo $tab_cartes[$x] . "\n"; }
vbelon at hotmail dot com
27-Jan-2004 10:51
To split $cartes which contains data and tabulations:
Doesnt work :
$tab_cartes = split("\\t",$cartes );

But \t = char(9), so, works well:
$tab_cartes = split(Chr(9),$cartes);

Idem for :
\n = char(10)
\r = char(13)

Found in http://www.asp-magazine.com/fr/asp/blitz/blitz4.asp