There may be use cases where you may need to add a leading zero to a number in PHP. By default such numbers are interpreted differently in PHP which may yield results you might not be expecting. Read the article to discover various ways of overcoming this issue and formatting the number correctly with leading zeros as you might be expecting.
window load events), and after waiting for a specified period of time.
NULL values are sorted first in MySQL, but what if we wanted to sort them last whilst sorting all other values in ascending order? Or how about if we wanted to sort
NULL values first, and all non-NULL values that followed in descending order? Both these scenarios can be a little tricky to tackle, which is why for your convenience, we've compiled a couple of ways to tackle these.