猿问

PHP5.3x ereg_replace改成preg_replace?

PHP5.3x ereg_replace改成preg_replace


烙印99
浏览 826回答 4
4回答

素胚勾勒不出你

$GLOBALS['index'] = 0;$search = "abcabcabcabc";$replace = preg_replace_callback("/a/", function($matches){return $GLOBALS['index']++ % 2 ? '*' : $matches[0];}, $search );var_dump($replace);
随时随地看视频慕课网APP
我要回答