You have several options: 1. using regular expressions <? $user = $_SERVER["HTTP_USER_AGENT"]; preg_match('/^([^\/]+).*/',$user,$matches); $browser = $matches[1]; ?> 2. using arrays <? $user = $_SERVER["HTTP_USER_AGENT"]; $tpm = explode('/',$user); $browser = $tmp[0]; ?> 3. using substrings <? $user = $_SERVER["HTTP_USER_AGENT"]; $browser = substr($user,0,strpos($user,'/'); ?> Sergiu Wikus Moller wrote:
Hi. I want to strip everything after a / in the HTTP_USER_AGENT for example: Opera 9.10/blah/blah would become only Opera 9.10 Lets say $user = $_SERVER["HTTP_USER_AGENT"]; $browser = ("/", $user); Is this correct? Isn't something needed in the browser variable? Thanks Wikus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php