Tag Archives: PHP

PHP – Detect Ajax Request (Shorthand)

It’s always useful to detect whether or not your script is directly accessed or accessed using Ajax. This function will detect the SERVER variables for HTTP_X_REQUESTED_WITH and use PHP shorthand syntax to return a boolean true or false value. This … Continue reading

Posted in PHP | Tagged , , | Leave a comment

PHP – Better Array Printing

There are always times when you need to print out an array to screen to either check it’s contents or simply get the right keys when working with your code. The most useful functions to do this are var_dump() and … Continue reading

Posted in PHP | Tagged , , | Leave a comment

Recursive Folder Scan using Recursive Directory Iterator

There are a few ways to list folder contents using PHP. One of the most simplest (and more under used) is the Recursive Directory Iterator provided by the SPL PHP library. I have included a sample function below of how … Continue reading

Posted in PHP | Tagged , , , | Leave a comment

Relative Time similar to Facebook & Twitter

Facebook and Twitter have a good way of displaying relative time, that’s natural and easy to read. I came across a piece of code a while back which I have improved upon to create a relative time PHP function – by passing in a … Continue reading

Posted in PHP | Tagged , , , | Leave a comment

PHP5 & Memcached (Example)

In this example I’ll be showing you how to read and write from a memcached server using PHP5, using singleton class design and some basic static functions to connect your servers up before performing the caching. For those of you … Continue reading

Posted in Code, PHP | Tagged , , | 1 Comment

Teamspeak 3: Connection Class

Due to the recently released Teamspeak 3 BETA I have made a connection class in PHP to communicate with the server and fetch back information that I can display in a visual format. I have included a download ZIP for … Continue reading

Posted in Code, PHP | Tagged , | Leave a comment

Basic Tutorial PHP/MySQL (Part 1)

One of the most requested tutorials are those that explain how to connect and use a MySQL database server with PHP code. I have written a basic tutorial showing how to perform MySQL queries with PHP. So you’re wanting to … Continue reading

Posted in Code, PHP | Tagged , , , | Leave a comment

PHPCache Release

I have been working on a small class to cache functions in PHP. I have come up with a class that will allow you to convert any standard function into a cached function with just one line of code. The … Continue reading

Posted in Code, PHP | Tagged , | Leave a comment