{"id":173,"date":"2020-10-13T02:08:57","date_gmt":"2020-10-13T02:08:57","guid":{"rendered":"https:\/\/barahasoft.com.np\/blog\/?post_type=codings&#038;p=173"},"modified":"2020-10-13T02:11:00","modified_gmt":"2020-10-13T02:11:00","slug":"detect-mobile-or-desktop-in-php","status":"publish","type":"codings","link":"https:\/\/barahasoft.com.np\/blog\/codings\/detect-mobile-or-desktop-in-php\/","title":{"rendered":"Detect mobile or desktop in php"},"content":{"rendered":"\n<p>This is the function which return boolean value whether it is mobile or desktop.<\/p>\n\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction isMobile() {\n    return is_numeric(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), &quot;mobile&quot;));\n}\n<\/pre>","protected":false},"featured_media":0,"parent":0,"template":"","tags":[63,64,65],"language":[37],"ctype":[40],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Detect mobile or desktop in php - BS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/barahasoft.com.np\/blog\/codings\/detect-mobile-or-desktop-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Detect mobile or desktop in php - BS Blog\" \/>\n<meta property=\"og:description\" content=\"This is the function which return boolean value whether it is mobile or desktop.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/barahasoft.com.np\/blog\/codings\/detect-mobile-or-desktop-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"BS Blog\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-13T02:11:00+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/barahasoft.com.np\/blog\/#website\",\"url\":\"https:\/\/barahasoft.com.np\/blog\/\",\"name\":\"BS Blog\",\"description\":\"Baraha Soft Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/barahasoft.com.np\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/barahasoft.com.np\/blog\/codings\/detect-mobile-or-desktop-in-php\/#webpage\",\"url\":\"https:\/\/barahasoft.com.np\/blog\/codings\/detect-mobile-or-desktop-in-php\/\",\"name\":\"Detect mobile or desktop in php - BS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/barahasoft.com.np\/blog\/#website\"},\"datePublished\":\"2020-10-13T02:08:57+00:00\",\"dateModified\":\"2020-10-13T02:11:00+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/barahasoft.com.np\/blog\/codings\/detect-mobile-or-desktop-in-php\/\"]}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/codings\/173"}],"collection":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/codings"}],"about":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/types\/codings"}],"wp:attachment":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/tags?post=173"},{"taxonomy":"language","embeddable":true,"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/language?post=173"},{"taxonomy":"ctype","embeddable":true,"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/ctype?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}