替换字符串除首尾为* function zxjStr($str){ $length = strlen($str); //先求长度 $star = str_repeat('*',$length-2); //要替换的字符串,是一串* $str2 = substr_replace($str,$star,1,$length-2); //开始替换整个字符串 r
function zxjStr($str){ $length = strlen($str); //先求长度 $star = str_repeat('*',$length-2); //要替换的字符串,是一串* $str2 = substr_replace($str,$star,1,$length-2); //开始替换整个字符串 return $str2; }