@Techible What did i write? The check string was Chrome, i just assigned "Google Chrome" to the $browser variable so it can be echoed to the user.. I did not search the agent for "Google Chrome"..
@sivaramakrish2007 I'm pretty sure it would be pretty much the same way but instead of searching for "Firefox", "Safari", and "Chrome", you would be looking for "Windows", "OSX" (or Macintosh?), and "Linux" (or Gnome/Unix?)
completly untrue. the ereg set of functions are for regular expression matching. they should be used if you are not using a regular expresion (which you are not).
i dont see why you would think that its better, there is ntign wrong with the strpos or substr methods, eregi is just being wasteful
THANK YOU
Techible 3 months ago
How can i do it with, Google Chrome???
Ramajual 7 months ago
@Ramajual else if (strpos($pre, "Chrome")!=0){ $browser = "Google Chrome"; }
Andrikouleas 4 months ago
@Andrikouleas No it would just be "Chrome", Google is not in the string
Techible 3 months ago
@Techible What did i write? The check string was Chrome, i just assigned "Google Chrome" to the $browser variable so it can be echoed to the user.. I did not search the agent for "Google Chrome"..
Andrikouleas 3 months ago
@Andrikouleas oh, i'm sorry. you were right
Techible 3 months ago
How ti Do it with Google Chrome???
Ramajual 7 months ago
great tutorial :) much appreciated
mttjep 1 year ago
can u tell how to detect OS platform that we r using ,in php
sivaramakrish2007 1 year ago
@sivaramakrish2007 I'm pretty sure it would be pretty much the same way but instead of searching for "Firefox", "Safari", and "Chrome", you would be looking for "Windows", "OSX" (or Macintosh?), and "Linux" (or Gnome/Unix?)
Techible 3 months ago
hey, ever check into getting Dreamweaver? Do you write all your pages from code only? Nice tutorials. Helpful.
ranger135xp 1 year ago
LOL, MSIE 8.0 is = Microsoft Internet Explorer 8.0
iNaoH 2 years ago
i like to use PHPCoder Pro instead of CONText...
superawesomesuperkid 2 years ago
it should be
if (strpos($pre, 'Firefox') !== FALSE){ // blah blah
}
what if the browser name was the first thing...
wideload123 2 years ago
no
if somethign is == to it then == 0 would check to see if the vlaue '0' is there.
where as = 0 means false, and = 1 is true
bowersbros 2 years ago
=== needs to match the type aswell...
FALSE === 0
is untrue
they was in the video, if the name of the browser was the first thing in the $pre string it would not work
wideload123 2 years ago
Don't use strpos - better is eregi
if (eregi("Firefox",$browser)){
// blah blah
}
Eregi is searching in the whole string and return true if the result was found.
Broady486 2 years ago
completly untrue. the ereg set of functions are for regular expression matching. they should be used if you are not using a regular expresion (which you are not).
i dont see why you would think that its better, there is ntign wrong with the strpos or substr methods, eregi is just being wasteful
wideload123 2 years ago
Hey, alex . You can make a tutorial about str_replace() php function
iAdrianv 2 years ago
hey how about a tut on how to add a downloading feature for a website???
it would be gr8....
crystalcyanide00 2 years ago
MSIE is plainly visible...
(Microsoft Internet Explorer)
sbrenn 2 years ago 2
Ah yes! Thanks for pointing that out! I'm so useless with Internet Explorer, I hate it...
phpacademy 2 years ago 8
So our strpos attribute would be "MSIE" and our browser variable would be "Internet Explorer"
Thanks bro :D
Cigotie 2 years ago
Yay you are a YouTube partner =D
takkieman 2 years ago
Thanks dude, really helpful.
NikkexD 2 years ago
You're most welcome!
phpacademy 2 years ago