Skip to content

Instantly share code, notes, and snippets.

@Abban
Created October 22, 2012 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Abban/3932377 to your computer and use it in GitHub Desktop.
Save Abban/3932377 to your computer and use it in GitHub Desktop.
PHP function to check if the current user agent is IEMobile/9.0 device
/**
* Is Windows Mobile
*
* Check to see if the user agent is a Windows Mobile
*
* @return boolean
*/
function is_windows_mobile(){
return strstr($_SERVER['HTTP_USER_AGENT'], 'IEMobile/9.0');
}
// Usage
if(is_windows_mobile()) echo 'Windows Mobile Sucks!';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment