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.
Are you looking for PHP pagination function? here one slick PHP function that will paginate your database records. You can easily combine this function in your project to paginate your database records. Just drop the function within your PHP script and call it wherever you’ll need the pagination.