This PHP code snippet writes text data to a given file. If file name does not exist, the file is created. Otherwise, the existing file is overwritten. This function is similar to above, except if file name already exists, append the data to the file instead of overwriting it.
This snippet allows you set a limitation for download rate of the file that visitors download from your site.
This is simple code snippet to measure page load time in PHP. This can be crucial for your web server if your php scripts load slow and take most of the CPU and RAM resources. Place the following code at the very top of your PHP page (if you measure the time needed for particular [...]
You can use the PHP mail() function to send an email with PHP. The simplest way to do this is to send a text email. Although is seems like a very trivial and easy to accomplish task sometimes there can be unexpected obstacles. In the code snippet example below we show you how to send [...]
Sometimes, you might want to get the current full URL in PHP. This PHP code snippet will also find out if the URL is on a secure URL or not, gets the server name and port number if needed and the current page.
This is handy function for converting bytes to KB, MB, GB, etc.
PHP code snippet to get real IP address of client even if he is behind a proxy server.
This is a handy little code snippet to check if server is running HTTPS. Nothing complicated simple PHP code!
This is a simple code snippet to convert a .pdf file into a .jpg image. Please note, you must have the Image Magick extension installed on your server to use this snippet. Credits: http://snipplr.com/view/48513