This post describes a method to download a file using a PHP script and resume the download if the previous download was interrupted. The code here could be used while downloading a new version of a PHP application from the application author’s website. Two implementation examples are provided – one using cURL and another using fsockopen.
This post describes how you can display relative or nicer time values like 10 days, 4 hours and 6 minutes ago instead of a date like 26 October, 2009 6:45 PM. The function is flexible enough to take a parameter for the details level you desire – for example, in the above example, the detail level was 3. So, it displays days, hours and minutes. If it was 4, it would have displayed seconds too. If we were using an older date, detail level of 3 might have displayed years, months and weeks.
This post is about a PHP class which allows you to check if a domain name is available or not using WHOIS servers. The class simply opens a socket connection to the WHOIS server and passes the domain name to check for. Based on the available string you provide, it checks if the domain name is available or not.
The code below is a wrapper class around the AES-128 implementation at http://www.phpclasses.org/browse/package/3650.html and the MCrypt extension. It use the MCrypt extension if it is enabled and use the pure PHP AES-128 class otherwise.
Most cURL wrapper classes I found could handle either the PHP extension or the command line executable version of cURL. I needed a class where I could set one variable and have it switch from using the PHP cURL extension to the cURL executable without having to change the other variable of the class.