function isWap() {
$http_agent = isset ( $_SERVER ["HTTP_USER_AGENT"] ) ? $_SERVER ["HTTP_USER_AGENT"] : '';
$pattern = "/vnd.wap|iphone|android|wap|iPhone|iPod|android|symbian|Nokia|UCWEB/i";
return preg_match ( $pattern, $http_agent ) === 1 ? true : false;
}