refiking Posted November 9, 2008 Share Posted November 9, 2008 I need to know how to determine if the $browser variable contains the word Firefox. Here's what I have so far: <?php $browser = $_SERVER['HTTP_USER_AGENT'] ; //IF $browser contains 'Firefox'{ $value = 1; } ELSE{ $value = 2; } ?> Link to comment https://forums.phpfreaks.com/topic/132042-browser-detection-search-variable-for-firefox/ Share on other sites More sharing options...
cooldude832 Posted November 9, 2008 Share Posted November 9, 2008 how about you do tihs <?php print_r($_SERVER); ?> And post what you find (look at source code) Then from there look at a preg_match Link to comment https://forums.phpfreaks.com/topic/132042-browser-detection-search-variable-for-firefox/#findComment-686153 Share on other sites More sharing options...
refiking Posted November 9, 2008 Author Share Posted November 9, 2008 I don't need to ouput this value. I simply need to find out if the $browser variable has the word Firefox. Link to comment https://forums.phpfreaks.com/topic/132042-browser-detection-search-variable-for-firefox/#findComment-686154 Share on other sites More sharing options...
cooldude832 Posted November 9, 2008 Share Posted November 9, 2008 Well I'm trying to teach you hear just try it I'm not going to spit out the regex code for you. Link to comment https://forums.phpfreaks.com/topic/132042-browser-detection-search-variable-for-firefox/#findComment-686155 Share on other sites More sharing options...
corbin Posted November 9, 2008 Share Posted November 9, 2008 http://php.net/strpos Link to comment https://forums.phpfreaks.com/topic/132042-browser-detection-search-variable-for-firefox/#findComment-686157 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.