function is_wechat() { $ug= isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:''; if( stripos($ug,'micromessenger') !== false ){ return true; } return false; }