Limit Download Speed Using PHP

Today’s featured PHP snippet is from Jonas John and it’s a simple and helpful solution for controlling a file’s download rate. This is very beneficial for those who have limited bandwidth. The code is still a bit rough around the edges and could use a bit more polishing. Like for one, the execution time doesn’t [...]

Continue Reading →

How to Censor Words Using PHP

Here’s a pretty neat and simple PHP snippet from PHPSnips that offers you a way to censor any word and then replace it with another word or string. Just provide a list of words you want censored out and let the code do the rest. This is definitely useful for BBS or forum sites, chat [...]

Continue Reading →

Add A Full Image Background To Your WordPress Login Screen

There are tutorials out there that teach you how you can have your own custom image logo in your WordPress login page but do you also know that you can do the same to your login page’s background? Adam Wadsworth of CatsWhoCode has put up together this nice snippet that will allow you to do [...]

Continue Reading →

Non-Recursively Deleting A Folder In PHP

In PHP, you can’t just delete a folder using rmdir unless the folder’s empty. You can, however, do so using rmdirr function, wherein it will remove both the folder and its contents recursively. But using this [recursive] method opens up the possibility for PHP to segfault/crash, specifically and especially if you have deeply nested directories [...]

Continue Reading →

2 Ways To Improve Your WordPress Search Page

Here are a couple of PHP snippets that you might want to incorporate in to your WordPress search file to improve your site’s search results page. The first one will display the number of results found, whereas the second will basically highlight the search terms used within the contents of the results. Image source To [...]

Continue Reading →

Twitter Nicks Format

Here’s a great PHP snippet that scans text and then searches for strings with an “@” symbol attached to it (i.e. Twitter handles like “@name”) and then converts them into linked text format. So basically it’s emulating what Twitter does with “@” symbols and “#” hashtags. <?php /** parseTwitterNicks * * convert text with format [...]

Continue Reading →

Put A Watermark On Top Of An Image Using PHP

Why put up with manually embedding watermarks on your images when you can have it done for you automatically using JavaScript, or in this case, PHP? This PHP snippet will make use of a image file (PNG) that you’ll create and supply, and place it on top of the photo you want watermarked at a [...]

Continue Reading →

How To Create ZIP files Using PHP

Previously, we posted a feature on a pretty neat script that allows you to unzip files (on a server) using PHP. This time, allow me to present you with a snippet that does the exact opposite: compress files into a zip file. Now, there are a handful of ways you can actually do this with [...]

Continue Reading →

Time Ago – Display How Long Something Has Been Posted Using PHP

Usually, websites and blogs display the date (month-day-year) of published posts, and then there are some that show you how long it has been since an entry was published by displaying something like “Posted 1 week ago”, “2 months ago”, “3 days ago”, etc. Today’s featured PHP snippet will allow you to do the latter. [...]

Continue Reading →

Display Current Number Of Online Users Using PHP

Here’s a classic but nonetheless still useful PHP snippet for those of you who’d like to keep tabs on the number of current online users on your website. This nifty script from PHPSnips checks the number of users within a given specific period of time with the use of a database. To be able to [...]

Continue Reading →

Page 2 of 7«12345»...Last »