I have a list of Mobile devices that I'm using to display content correctly. The depreciated function looks like this:
function detectPDA($query){
    $browserAgent = $_SERVER['HTTP_USER_AGENT'];
    $userAgents = $this->getBrowserAgentsToDetect(); // comma separated list of devices
    foreach ( $userAgents as $userAgent ) {
        if(eregi($userAgent,$browserAgent)){
            if(eregi("iphone",$browserAgent) || eregi("ipod",$browserAgent) ){
                $this->iphone = true;
            }else{
                $this->pda = true;
            }
        }
    }
}
What is the correct way to replace the eregi functions?
 
    