Get basename and file extension with PHP or Javascript
Getting file extension and basename is a common development task. PHP internal function pathinfo is very useful. But, Windows paths will not work correctly on Linux servers and vice versa.…
Getting file extension and basename is a common development task. PHP internal function pathinfo is very useful. But, Windows paths will not work correctly on Linux servers and vice versa.…
Virtual disks (Virtualbox in our case) are very large files, that may change frequently. This is a big problem for backup. A little change (even a simple boot of virtual…
It is useful to prevent direct access of AJAX calls (from browser address bar). A solution could be the following simple function check_is_ajax(): /** * Check if request is an…
Date manipulation is a common and extremely useful development task. It was never easy with PHP, until PHP5 and DateTime class. There are many cases you need to convert dates.…
Sometimes you want to check if a string represents a valid timezone. Using PHP versions greater than 5.2, timezone_identifiers_list() could be a solution. Take a look in the following function:…