i would like to check if Web page Users use ie, any Other Browser or and iPhone. I have a php Script which Checks for every Browser, but that Means something like 20 elseif statements.
I think, that putting Firefox, Safari, chrome, ie and iPhone As the first statements would mean it only goes through all elseifs if the Browser is different to those above and otherwise stop executing. At least if i but a Break in there. Is that true or do i Need to Write a more simple Script for this purpose? thanks.
BTW sorry for all the caps, stupid iPhone autocorrection.
In an elseif chain if any of the conditions is true, the others won’t be evaluated. You don’t have to put in any breaks.
Also, even evaluating 20 ifs is so quick that you don’t have to worry about it. Putting the most popular browsers first is a sensible idea though.