note 51164 deleted from function.get-browser by nlopess

From: Date: Tue, 22 Mar 2005 15:33:11 +0000
Subject: note 51164 deleted from function.get-browser by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-86790@lists.php.net to get a copy of this message
Note Submitter: fjocke at hotmail dot com Reason: useless ---- <?PHP //Created by joakim forslund 2005 //You may use this script exactly how you want aslong as you keep this notice in the top of the code! //Show what browser and what verision you are running $Browser = $_SERVER['HTTP_USER_AGENT']; // Gets the information header $Browser = strtolower($Browser); // Makes everything into lowercase $browser_exp = explode(" ", $Browser); //Since the returned line has " " space between every single diffrent information topic it makes it easy to create an array and pick out what browser it is $browser_exp = array_reverse($browser_exp);// Makes the Array reversed so you only need to pick the first alternative $tmp = $browser_exp[0]; //Binds tmp too the browser name and the version $string_exp = explode("/", $tmp); // Since its a "/" between the browser name and version we need to explode that aswell. echo "Browser: ".$string_exp[0]."<BR>"; // Gives the browser name echo "Version: ".$string_exp[1]."<BR>"; // Gives teh browser version ?>

« previous php.notes (#86790) next »