if(strpos('www.idc-gz.com','idc-gz') !== false){ echo '包含'; }else{ echo '不包含'; } 该函数对大小写敏感。如需进行对大小写不敏感的搜索,请使用 stripos()函数。