Using server-side detection with PHP


show more Using server-side detection with PHP provides you with in-depth training on Developer. Taught by Joe Marini as part of the Mobile Web Design & Development Fundamentals show less
please wait ...

Using server-side detection with PHP

So, in this example we are going to see how to do some simple server-side user agent detection using PHP. I've got my DetectTestPHP.php file open here in my code editor, and I've got a PHP file over here called detect_mobile_ua.php, and this is the file that we are going to fill out and will be working on. So let's go back to the main code, and let me show you what I am doing here. So if you don't know PHP deeply, you are not familiar with it, you should be able to follow along, because I am not really doing anything all that complex here.

All I am doing here at the top of file is including my detect_mobile_ua.php file, and that's going to contain the code that does all of the user agent detection. And inside that file, I have a function called detectMobileUA, which returns a result, which will be saved aside in this variable here called ismobile. And you can see that's right here. That's detectMobileUA. Right now, it's just returning false because we haven...

Using server-side detection with PHP
Video duration: 6m 52s 5h 47m Beginner

Viewers:

Using server-side detection with PHP provides you with in-depth training on Developer. Taught by Joe Marini as part of the Mobile Web Design & Development Fundamentals

Subjects:
Developer Web
Software:
HTML
Author:
please wait ...