Hey everyone,
I am currently working on my portfolio website toddhartsfield.com to be fully responsive. Everything seems to work with iPhone and Android fine, but I am annoyed that when I go to my works page on a mobile device the images of my works are bigger than the devices screen. I want to make a new gallery with the same images optimized for say... a typical iPhone/android screen at 72ppi using a jQuery API known as photoswipe. I have used it before and it worked really well.
PHP is not my strong suit... or programming in general. I did make an attempt to make a block of PHP code.
< ?php
$browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone"); || stristr($_SERVER['HTTP_USER_AGENT'],'android');
if ($browser == true) { echo 'code for photoswipe'; }
elseif ($browser ==false) { echo 'code I already have' }
?>
The code above I tried to make it work by finding if the browser from the client (if it is iPhone OR'||' Android do code B) If neither is found do code A.
Is the code above feasible or is there a better way to put this into a php block?
Thank You in advance!



Thank you so much for your expertise!!! I will work on this and let you how it turns out... Okay this may seem a dumb, but I want to make sure I would put the code in the right area. Near the end should it be like this:
