[PHP-users 28662] Re: 空白文字での分割について
前田 俊一郎
maeda @ dglt.co.jp
2006年 3月 9日 (木) 10:29:00 JST
Ten$BMM!!CfB<MM(B
$B%"%I%P%$%9$NJ}$"$j$,$H$&$4$6$$$^$9!#(B
Ten$BMM$,65$($F2<$5$C$?%^%K%e%"%k2U=jJY6/$K$J$j$^$7$?!#$"$j$,$H$&$4$6$$$^$9!#(B
$BCfB<MM$N(B
$result = preg_split("/[\s|$B!!(B]*/", $_GET['search_name']);
print_r($result);
$B$G!"!V$`!<$P!!$i$s$5!W$HF~NO$7!"F0:n3NG'$7$^$7$?=j!"(B
Array ( [0] => [1] => $B!&(B [2] => $B!&(B [3] => [4] => $B%7(B [5] => $B!&(B [6] => $B%_(B [7] =>
[8] => $B!&(B [9] => $B!&(B [10] => $B!&(B [11] => $B!&(B [12] => $B!&(B [13] => $B%*(B [14] => )
$B$H$J$j$^$7$?!#$3$l$O$&$^$/$G$-$F$J$$$H;W$C$?$N$G!"9M$($F$$$?=j!"(B
explode$B4X?t$r;W$$=P$7$?$N$G!"(B
$result=explode(" ",$_GET['search_name']);
foreach($result as $value){
print($value."<br/>");
}
$B$H$7$?$H$3$m!"(B
$B!&`#%7!&%_(B
$B!&r''%*(B
$B$H!"$&$^$/J,3d$G$-$k$h$&$K$J$j$^$7$?!#(B
$B$^$@=i?4<T$N0Y!"$3$l$O(BTen$BMM$N%"%I%P%$%9!J"-2<5-!K$K4X78$,$"$k$H;W$o$l$^$9$,!"(B
http://www.php.net/manual/ja/ref.mbstring.php
$BE*$r30$7$F$$$?$i?=$7Lu$J$$$G$9!#(B
$B0J>e$G$9!#(B
PHP-users メーリングリストの案内