日期:2014-05-17 浏览次数:20751 次
$s = 'ssssssssgsdfasdasdasdasdjlkjhkjhalkasdasdjsdkajshdasdaklsjdasdhkjashgdaklsh';bool(true)
$t = 'ssssssssgsdfasdjlkjhkjhalkjsdkajshdaklsjdhkjashgdaklsh';
$s = preg_replace_callback('/asd/', function($r) {
static $n = 0;
return ! $n++ ? $r[0] : '';
}, $s);
var_dump($s == $t);