Get a domain name’s IP address with PHP

It’s easy to get the IP address for a domain name using PHP’s gethostbyname() and gethostbynamel() functions. This post looks at some examples of using thegethostbyname() function in PHP to get a single IP address for a hostname.

Categories PHP

PHP is not showing any error messages

Help! There are errors in my PHP code and there are no error messages being displayed. I’ve even set error_reporting to E_ALL and still PHP is not displaying the errors. How do I debug it? How do I show the errors? This post looks at the very simple answer to these questions. display_errors configuration variable …

Read more

Categories PHP

Force reload of updated CSS and Javascript files with unique filenames

When a CSS or Javascript file is changed the visitor’s browser needs to get the latest copy of the file to reflect the changes, but it will have been cached and may cause rendering or functionality issues depending on the changes. To force reloading of the CSS and Javascript file the files should be renamed each time they are changed; this can be automated by using PHP to add the timestamp of the file into the filename.