', '', $str); $str = str_replace('《', '', $str); $str = str_replace('》', '', $str); $str = str_replace('.', '', $str); $str = str_replace('。', '', $str); $str = str_replace('/', '', $str); $str = str_replace('、', '', $str); $str = str_replace('?', '', $str); $str = str_replace('?', '', $str); $str = str_replace('╮', '', $str); $str = str_replace('(', '', $str); $str = str_replace(')', '', $str); $str = str_replace('r', '', $str); $str = str_replace('ぷ', '', $str); $str = str_replace('〆', '', $str); $str = str_replace('ゞ', '', $str); $str = str_replace('ヤ', '', $str); $str = str_replace('ゼ', '', $str); $str = str_replace('ǎ', '', $str); $str = str_replace('ǎ', '', $str); $str = str_replace('〆', '', $str); $str = str_replace('む', '', $str); $str = str_replace('§', '', $str); $str = str_replace('上门', '', $str); return trim($str); } /** * 判断字符串是否包含某个字符 * @param $str * @param int $nee * @param string $del * @return bool */ public function exitContain(string $str, $nee = 3, $del = ','): bool { if (strpos($str, $del) !== false) { $var = explode($del, $str); foreach ($var as $v) if ($v == $nee) return true; return false; } else { if ($str == $nee) return true; return false; } } /** * 统计字符串长度 * @param string $str 字符串 * @return int */ public function len(string $str): int { return strlen($str); } /** * 删除空格 * @param $str * @return string|string[] */ public function trimAll($str): string { $oldchar = array(" ", " ", "\t", "\n", "\r"); $newchar = array("", "", "", "", ""); return str_replace($oldchar, $newchar, $str); } /** * 替换字符串 * @param string $search * @param string $replace * @param string $subject * @return string|string[] */ public function replace(string $search, string $replace, string $subject) { return str_replace($search, $replace, $subject); } }