var_dump(
preg_replace('/.?$/s', "x", 'abc'),
preg_replace('/.$/s', "x", 'abc')
);
输出:
string(4) "abxx" <-- strange, isn't it?
string(3) "abx"
这怎么可能?
var_dump(
preg_replace('/.?$/s', "x", 'abc'),
preg_replace('/.$/s', "x", 'abc')
);
输出:
string(4) "abxx" <-- strange, isn't it?
string(3) "abx"
这怎么可能?