{"id":5188,"date":"2025-11-30T15:09:48","date_gmt":"2025-11-30T15:09:48","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=5188"},"modified":"2025-11-30T15:09:49","modified_gmt":"2025-11-30T15:09:49","slug":"device-type-detect","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/browsers-devices\/device-type-detect","title":{"rendered":"Device type detect"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Is user using a mobile device?<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/***************************************************\n\/\/***************************************************\n\/\/********** IS USER USING A MOBILE DEVICE **********\n\/\/***************************************************\n\/\/***************************************************\nfunction DeviceDetectIsUsersDeviceMobile()\n{\n  $UserAgent = $_SERVER&#91;'HTTP_USER_AGENT'] ?? '';\n\n  \/\/CheckForIOS\n  $IsIOS = preg_match('\/iPhone|iPad|iPod\/i', $UserAgent);\n\n  \/\/CheckForAndroid\n  $IsAndroid = preg_match('\/Android\/i', $UserAgent);\n\n  if($IsIOS || $IsAndroid)\n    return True;\n  else\n    return False;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Is user using a mobile device?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[388],"tags":[],"class_list":["post-5188","post","type-post","status-publish","format-standard","hentry","category-browsers-devices"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=5188"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5188\/revisions"}],"predecessor-version":[{"id":5189,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5188\/revisions\/5189"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=5188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=5188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=5188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}