search into a string and check if the result is in a list with php
<p>Just a simple question about performance and scalability.
I need to recognize the exactly model of an Android phone from its user-agent string and then call a page if the model is in a specific list. So I use "stristr" function and a simple if condition, in the following way:</p>

<pre><code>$ua = $_SERVER['HTTP_USER_AGENT'];
if ( stristr($ua, "Nexus S") || stristr($ua, "GT-I9003")  || stristr($ua, "GT-I9000") || stristr($ua, "SGH-T959D") || stristr($ua, "SGH-I897") || stristr($ua, "GT-I9088") || stristr($ua, "GT-I9100")  ) {
        $page = "android_specific.html";
        header('Location: ' . $page);
    } 
</code></pre>

<p>So the question is: is there a more elegant and maybe better (faster) way to make this comparison? I guess with an array and a for cycle?</p>

<p>Thank you so much in advance.</p>
