Microsoft Access database is not a preferred choice to store sensitive or large amount of data, because it is not so robust as other database, you will soon discover several limitation as your database size grows. However for small business and individuals Access database is ideal alternative, it is cheap to setup and simple to use! Let’s find out how easily we can play with Access database using PHP PDO.
You can use example below in many different situations, idea is to create a list of quotes in array, and using PHP array_rand(), we can pick random entries out of an array.
Many of us like to share files publicly on our websites, pointing directly to downloadable contents! But this can be risky as you might be exposing stuff you wouldn’t want public to know.
Instead of pointing to downloadable files directly, you can use this PHP snippet to force download them. This way the original file path will be hidden from the public and you’ll feel bit secure. Just copy paste this function into a PHP file and call it when needed.
header('Content-Disposition: attachment; filename="'.basename($dl_file).'"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($dl_file)).' GMT');
I needed a PHP function that returns HTML Entity of currency codes, so I have written this small function with list of major currency symbols of the world, I hope this will be useful.