Join Kevin Skoglund for an in-depth discussion in this video Browser detective, part of Easy PHP Projects: Single-Serving Sites.
- We've already learned how to view the user agent string…using PHP by asking the server super global…for the value that has the key HTTP_USER_AGENT…What we get back is a very long string…that describes the user agent.…This can be a little bit difficult to decipher…there's a lot of information packed in there.…What we really want is just to very quickly find out…what operating system is this person using…and what browser are they using?…So what I want to do now is try and develop a way…that we can tease that information out of here…to make it more accessible.…
PHP offers us a built in function for this purpose…called get_browser.…You can find out more information about it…at the php.net website.…get_browser determines the browser, the platform,…the version, and even the different feature capabilities.…But, get_browser depends on an external file…being present and configured.…It's called browscap.ini and therein lies the problem.…I don't like get_browser, mostly because it depends…on that file and that file is not bundled with PHP.…
- Finding and validating an IP address with PHP
- Parsing the HTTP request for browser details
- Comparing dates and times in PHP
- Randomizing data with PHP
- Styling page content dynamically
- Generating random sentences
Skill Level Beginner
1. What is My IP Address?
2. Browser Mirror
3. Is it New Years Yet?
4. Random Data and Styling
5. Random Phrase Generator
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.