PHP detect IOS / iPhone / iPad / iPod

Very simple

<?php
function is_ios(){
    if (stripos($_SERVER['HTTP_USER_AGENT'],"iPhone")  !== false) {
        return true;
    } elseif (stripos($_SERVER['HTTP_USER_AGENT'],"iPad") !== false) {
        return true;
    } elseif (stripos($_SERVER['HTTP_USER_AGENT'],"iPod") !== false) {
        return true;
    }
    return false;
}
?>
Posted in php

One thought on “PHP detect IOS / iPhone / iPad / iPod

  1. hi great job but for me does’t work , i’ve copy your code but it appears on my depiction page, and you have a same code to display the udid? thank you for your help

Leave a Reply

Your email address will not be published. Required fields are marked *