$str = "!uploadIMG\/day_120207\/201202071608434997"; 去字符

$str = "!uploadIMG\/day_120207\/201202071608434997";
将第一个!及以后的\去掉
简单粗暴一点的话,直接用str_replace,字符串替换
$str = str_replace('!','',$str);
$str = str_replace('\','',$str);


稍微复杂一点的话,用正则替换
$str = preg_replace('/(^!)|(\\)/','',$str);
将开头的!或者\字符替换成空字符(^表示开头)

你可能感兴趣的:($str = "!uploadIMG\/day_120207\/201202071608434997"; 去字符)