Is there a PHP (or JS) script that can detect responsive?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Is there a PHP (or JS) script that can detect responsive?

Post by simonmlewis »

I am looking to add a page to a website, where a customer can enter their web site address, hit the button and it will tell them if their site is "responsive/mobile-friendly".

I just think it would be a cool feature.

I guess the only way is with Javascript though, as PHP would be MY server side.

Any ideas? I guess it could check for the @media in CSS, but not sure what else.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Is there a PHP (or JS) script that can detect responsive

Post by Celauran »

simonmlewis wrote:I guess it could check for the @media in CSS
That's about the only thing that readily comes to mind, but it won't give you much. Having media queries shows they've tried, but not necessarily that they've succeeded. You could further check which breakpoints they've set and how many, but that's still scratching the surface.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Is there a PHP (or JS) script that can detect responsive

Post by Christopher »

Analysis will be difficult. Maybe it would be better to render images of the page in phone, tablet and desktop resolutions using the command line and a browser on the server. The show the images to the user.
(#10850)
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Is there a PHP (or JS) script that can detect responsive

Post by simonmlewis »

Do you mean, make a "virtual browser", and show that in a DIV on the web page - if so, how???
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Is there a PHP (or JS) script that can detect responsive

Post by Christopher »

Projects like this http://phantomjs.org/ and similar.
(#10850)
Post Reply