You need JavaScript, not PHP.
var screenWidth = window.screen.width,
screenHeight = window.screen.height;
You can then send it to the server via Ajax (with an XmlHttpRequest
).
See also the MDC window.screen
docs.
More Related Contents:
- Getting the screen resolution using PHP
- Fatal error: Switch statements may only contain one default clause (php7)
- Warning: foreach staement
- syntax error unexpect something [closed]
- Parse error: syntax error, unexpected ‘;’ [closed]
- PHP – SSL certificate error: unable to get local issuer certificate
- How to use php serialize() and unserialize()
- Insert multiple rows with one query MySQL
- Why does PHP 5.2+ disallow abstract static class methods?
- Dompdf and set different font-family
- How to upload large files above 500MB in PHP [duplicate]
- Allowed memory size of X bytes exhausted
- With “magic quotes” disabled, why does PHP/WordPress continue to auto-escape my POST data?
- localhost vs. 127.0.0.1 in mysql_connect()
- How to check if a file exists from a url
- PHP – include a php file and also send query parameters
- How to detect shot angle of photo, and auto rotate for website display like desktop apps do on viewing?
- How to use RegexIterator in PHP
- Accessing session from TWIG template
- sum specific values in a multidimensional array (php)
- How to alias the name of a column in Eloquent
- PHP: strtotime is returning false for a future date?
- How to select multiple rows from mysql with one query and use them in php
- Why does this PHP code just echo “Array”?
- Go Back to Previous Page
- Find out the error_log’s path
- Static class initializer in PHP
- What is difference of developing a website in MVC and 3-Tier or N-tier architecture?
- Add a custom checkbox in WooCommerce checkout which value shows in admin edit order
- PHP Find all occurrences of a substring in a string