裁剪字符串问题../user/123456/230216511.jpg我想把前面的2个点去掉、怎么弄?就是变成/user/123456/230216511.jpg[解决办法]
$str = '../user/123456/230216511.jpg';echo preg_replace('/^(\.){2}/', '', $str);//或者if (substr($str, 0, 2) == '..') echo substr($str, 2);