A fresh mix of code snippets and tutorials

Category Archive: PHP

Posts about PHP

Page 5 of 7

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.

Strip Slashes from PHP Magic Quotes

Here are a couple of functions to strip or remove slashes (i.e., backslashes) from variables when PHP magic quotes are enabled on the server.

Date and Time with PHP and WordPress

This post explains the difference between displaying the date and time with PHP vs. displaying the date and time with WordPress.

Add Custom Info to PHP System Log

Here is a quick function for adding custom information to the system log via PHP.

Recursively display images via PHP

Here is an easy way to display all images in a directory — including images contained in sub-directories.

Add links to HTML/CSS Validator

Here are some notes and markup examples for adding links to the W3C’s online HTML and CSS validators. This will enable your visitors to check any page on your site.

PHP: Target IE less than 9

Recently I haven’t had time to bother with old versions of IE (less than 9), so I use the following PHP function to target IE 6, 7 and 8.

PHP: Get current URL

Nice lil slab of PHP to get the current URL. Useful for a wide variety of applications, nice one to have in the tool belt.

WordPress get all user emails

Quick snippet to get all user emails in WordPress.

Structure of $_FILES array

Working with USP Pro involves a lot of $_FILES manipulation. I tend to forget how the array is structured, so I’m posting it here for ez reference.