Reputation: 14827
I want to detect if user using iphone type lower than iphone 4 in order to run different kind
of HTML5 video because iphone 3 can only run low quality video. Can someone give me some
solution to achieve this goal. Thank you very much in advance!
Upvotes: 0
Views: 1238
Reputation: 1470
I've used this on several high traffic sites its light and does a fantastic job
http://code.google.com/p/php-mobile-detect/
Upvotes: 1
Reputation: 5425
On server (php):
<?php
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Apple-iPhone3C')!==false || strpos($_SERVER['HTTP_USER_AGENT'], 'Apple-iPhone4C')!==false) {
echo 'iPhone 4';
} else {
echo 'other model';
}
See also: detect in browser.
Upvotes: 0