user3656554
user3656554

Reputation: 111

Interlinking css with php

I'm trying to get a php function to only happen once a css style happened.

For example when my screen is 800px wide then that specific php function must happen.

Is there a way to do that? And if so how do you go about doing it?

Upvotes: 0

Views: 71

Answers (1)

RazvanZ
RazvanZ

Reputation: 218

Try Tera-WURFL, a PHP & MySQL-based software package that detects mobile devices and their features.

The code to detect the browser width in PHP:

<?php
require_once("TeraWurfl.php");
$wurflObj = new TeraWurfl();
$wurflObj->GetDeviceCapabilitiesFromAgent();
$browser_width = $wurflObj->capabilities['display']['max_image_width'];
// Also, you can get the display resolution
$display_width = $wurflObj->capabilities['display']['resolution_width'];
?>

Upvotes: 1

Related Questions