PHP : Function Reference : Multibyte String Functions : mb_ereg_search
dulao5
mb_ereg_search & subpatterns
use loop:
<?php
$str = "ä¸å½abc + abc ?!ï¼ï¼å符ï¼ãchina string";
$reg = "\w+";
mb_regex_encoding("UTF-8");
mb_ereg_search_init($str, $reg);
$r = mb_ereg_search();
if(!$r)
{
echo "null\n";
}
else
{
$r = mb_ereg_search_getregs(); //get first result
do
{
var_dump($r[0]);
$r = mb_ereg_search_regs();//get next result
}
while($r);
}
?>
|