Added: 2 years ago
From: phpacademy
Views: 6,762
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (25)

Sign In or Sign Up now to post a comment!
  • THANK YOU

  • How can i do it with, Google Chrome???

  • @Ramajual else if (strpos($pre, "Chrome")!=0){ $browser = "Google Chrome"; }

  • @Andrikouleas No it would just be "Chrome", Google is not in the string

  • @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 oh, i'm sorry. you were right

  • How ti Do it with Google Chrome???

  • great tutorial :) much appreciated

  • can u tell how to detect OS platform that we r using ,in php

  • @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?)

  • hey, ever check into getting Dreamweaver? Do you write all your pages from code only? Nice tutorials. Helpful.

  • LOL, MSIE 8.0 is = Microsoft Internet Explorer 8.0

  • i like to use PHPCoder Pro instead of CONText...

  • it should be

    if (strpos($pre, 'Firefox') !== FALSE){ // blah blah

    }

    what if the browser name was the first thing...

  • 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

  • === 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

  • 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.

  • 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

  • Hey, alex . You can make a tutorial about str_replace() php function

  • hey how about a tut on how to add a downloading feature for a website???

    it would be gr8....

  • MSIE is plainly visible...

    (Microsoft Internet Explorer)

  • Ah yes! Thanks for pointing that out! I'm so useless with Internet Explorer, I hate it...

  • So our strpos attribute would be "MSIE" and our browser variable would be "Internet Explorer"

    Thanks bro :D

  • Yay you are a YouTube partner =D

  • Thanks dude, really helpful.

  • You're most welcome!

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more