0

I got screen width by using javascript:-

<script type="text/javascript">var sw = document.body.scrollWidth ;</script>

Then i stored the value of the width in a php variable :-

$screenWidth1 = "<script>document.writeln(sw);</script>";

Now i want to use $screenWidth1 in a condition like this:-

if ($screenWidth1 < '960') {echo "working";} 

But it does not work, when we print $screenWidth1, it shows the correct value, but in condition its not work.

Please let me know if there any solution.

Manashvi Birla
  • 2,811
  • 3
  • 12
  • 27

0 Answers0