How to check if a Request is AJAX call with PHP
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…
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…
The term "localization" is used as a synonym of "internationalization", which is the most proper term. Sometimes, internationalization is shortened to "i18N" (meaning "i - eighteen letters -n"). gettext is…
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:…
Prepared statements must be used in application development with databases. There are two main reasons: performance: parameterized queries with prepared statements reduces the database load, reusing access plans that were…