A fresh mix of code snippets and tutorials

Category Archive: PHP

Posts about PHP

Page 4 of 7

Filter pre tags in bbPress

A couple of functions used at htaccessbook.com to enable unescaped/unencoded pre and code tags in bbPress forum posts.

Display a Simple “Tweet This” Link

Twitter changes their API quite a bit, however it is still possible to display a simple “tweet this” link anywhere on your web pages.

WordPress Check PHP Version

When working with the WP API, you may need to check the current version of PHP to ensure compatibility.

PHP Send Bulk Emails from Text File

This post provides a couple of PHP code snippets that enable you to send emails from a text file. Send in plain-text format and plain-text with embedded image.

Simple Ajax Chat Test Script

When testing my plugin, Simple Ajax Chat (SAC), I use the following script to save time testing various chat functionality. Posted here in case it’s useful for others. Note this is for the free version of SAC. Enjoy!

PHP Detect All Versions of IE

Quick code snippet for detecting all versions of good ’ol IE (Internet Explorer).

PHP Get Actual IP Address

Here are a couple of quick snippets to get the visitor’s actual IP address via PHP.

Check for PHP cURL

Quick snippet for checking whether or not PHP’s cURL is available on the server.

Truncate Database Table

Quick SQL code snippet that enables you to truncate any MySQL database table.

Find duplicate email addresses in WordPress

This tutorial explains how to find duplicate email addresses in your WordPress database. That way you can delete or modify as needed.

Get All User Email Addresses in WordPress

Putting together a mailing list? Here is an easy way to get all user email addresses from your WordPress database.

PHP Error Log Tricks

Super useful trick for customizing error logs when working with PHP.