php için sınıf şu şekilde

class tarayiciTipi {
    var $tarayiciKimlik;
    function TarayiciAl() {
    
    $tarayici_am = stristr ( $_SERVER['HTTP_USER_AGENT'], "amaya"         );
    $tarayici_cb = stristr ( $_SERVER['HTTP_USER_AGENT'], "Crazy Browser" );
    $tarayici_mx = stristr ( $_SERVER['HTTP_USER_AGENT'], "Maxthon"       );
    $tarayici_ab = stristr ( $_SERVER['HTTP_USER_AGENT'], "Avant Browser" );
    $tarayici_fl = stristr ( $_SERVER['HTTP_USER_AGENT'], "Flock"         );
    $tarayici_ff = stristr ( $_SERVER['HTTP_USER_AGENT'], "Firefox"       );
    $tarayici_ns = stristr ( $_SERVER['HTTP_USER_AGENT'], "Netscape"      );
    $tarayici_sa = stristr ( $_SERVER['HTTP_USER_AGENT'], "Safari"        );
    $tarayici_ga = stristr ( $_SERVER['HTTP_USER_AGENT'], "Galeon"        );
    $tarayici_kq = stristr ( $_SERVER['HTTP_USER_AGENT'], "Konqueror"     );
    $tarayici_lx = stristr ( $_SERVER['HTTP_USER_AGENT'], "Lynx"          );
    $tarayici_op = stristr ( $_SERVER['HTTP_USER_AGENT'], "Opera"         );
    $tarayici_ie = stristr ( $_SERVER['HTTP_USER_AGENT'], "MSIE"          );
    

    if     ( $tarayici_am ) { $this->tarayiciKimlik = "am"; }
    elseif ( $tarayici_cb ) { $this->tarayiciKimlik = "cb"; }
    elseif ( $tarayici_mx ) { $this->tarayiciKimlik = "mx"; }
    elseif ( $tarayici_ab ) { $this->tarayiciKimlik = "ab"; }
    elseif ( $tarayici_fl ) { $this->tarayiciKimlik = "fl"; }
    elseif ( $tarayici_ns ) { $this->tarayiciKimlik = "ns"; }
    elseif ( $tarayici_sa ) { $this->tarayiciKimlik = "sa"; }
    elseif ( $tarayici_ga ) { $this->tarayiciKimlik = "ga"; }
    elseif ( $tarayici_kq ) { $this->tarayiciKimlik = "kq"; }
    elseif ( $tarayici_lx ) { $this->tarayiciKimlik = "lx"; }
    elseif ( $tarayici_op ) { $this->tarayiciKimlik = "op"; }
    elseif ( $tarayici_ff ) { $this->tarayiciKimlik = "ff"; }
    elseif ( $tarayici_ie ) { $this->tarayiciKimlik = "ie"; }
    else                     { $this->tarayiciKimlik =  "";  }
    
  }
  
}
ilgili sınıfın kullanımı şu şekilde

include ( "tarayicitipi.php" );
$tarayici = new tarayiciTipi();
$tarayici->TarayiciAl();

if ( $tarayici->tarayiciKimlik == "ff" )
{
echo "Devam";
}
else
{
// mesaj yada yönlendirme
}