How-to: Basic Chat App w/ PHP, jQuery & Ajax

Posted on July 24, 2012 by Jimmy K. in Projects, Tutorials.

One of my friends recently asked for assistance with a chat application he’s developing and, while his is a bit more robust than the one I set out to create, I decided to build one from the ground up to wrap my head around it. The code below took a few hours to compile, but [...]


PHP: Check if an email address exists.

Posted on March 9, 2012 by Jimmy K. in Tutorials.

As some of you may know, I built and run a small email marketing application. Some of our clients’ lists are as old as dirt, so one of the services we provide is a simple test to determine whether or not an email address actually exists. This function goes through all the normal steps of [...]


PHP: Detect the user’s operating system.

Posted on March 9, 2012 by Jimmy K. in Tutorials.

I wrote this function as a companion to my jDetectBrowserType() function. I rarely need to use it, but it’s good to have in your arsenal just in case. This function will return the user’s operating system as a string and supports the most popular desktop and mobile operating systems. An example of this function can [...]


PHP: Detect the user’s browser type.

Posted on March 9, 2012 by Jimmy K. in Tutorials.

At some point you may need to know the user’s browser type to handle browser-specific events. Most likely, this information will be used to determine which CSS properties you can use to make a web page display the same across all browsers. This function will return the user’s browser type as a string. In the [...]


PHP: Create zip files using ZipArchive.

Posted on February 21, 2012 by Jimmy K. in Tutorials.

PHP has a pretty neat built-in class called ZipArchive that lets you create zip files on a web server at run-time. In a recent update to the END[SEVEN] Cloud, I completely automated the packaging process for downloadable class files and examples using the ZipArchive class. How to use this function: This function accepts an array [...]


PHP: Calculate a person’s age.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Sometimes you’ll need to calculate an age. It could be the age of a member on your website… It could be your cat. Either way, this can be useful for a variety of reasons such as personalized messages, criteria-based marketing or any functionality that is based on age demographics. I’ve seen a few different versions [...]


PHP: Implode an array into a readable format.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

I was recently asked to write a function that implodes a list of items in an array into a human-readable list. For example, [[0] => “Jimmy”, [1] => “Ryan”, [2] => “Ken”, [3] => “Barbie”] would become “Jimmy, Ryan, Ken and Barbie” and [[0] => “apple”, [1] => “banana”] would become “apple and banana”. This [...]


PHP: Validate email address format using RegEx.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Email addresses are used for pretty much everything. Registrations, usernames, lead generation… Everything. They are as unique as a telephone number or physical address and require validation just like any other piece of data. I’ve come across a lot of poorly written email validation scripts, but this one has risen from the ashes in a [...]


PHP: Auto-hyperlink URLs using RegEx.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Have you ever typed a URL into an email or website and a clickable hyperlink was automagically created? Regular expressions, baby! Check it out: This function accepts three arguments; $sInput, $sTarget (optional), and $sClassName (optional). $sInput is the text you would like to search and create hyperlinks for, $sTarget is the target window that hyperlinks [...]


PHP: How to truncate characters and words…

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Sometimes you just need to shorten that huge wall of text. Here are two functions that I use frequently to limit the display of lengthy user input: The first function, jTruncate(), truncates text if it is greater than the specified number of characters. For example, if you pass “This is a large block of text!” [...]


PHP: Recursive Cleanup (for Web Servers)

Posted on October 4, 2011 by Jimmy K. in Articles, Tutorials.

For as long as I can remember, I’ve loathed .DS_Store and Thumbs.db files. They always seem to crawl their way onto my hosting servers. By definition, the .DS_Store file is “a hidden file created by Apple’s Mac OS X operating system to store custom attributes of a folder such as the position of icons or [...]


PHP: MySQLGoodies class has been updated!

Posted on September 16, 2011 by Jimmy K. in Articles, Tutorials.

I’ve recently started programming an international traveling website that accepts input from users all over the world. Since it’s likely that users will type in their native language, the functionality to accept accented characters became an absolute necessity. I’ve recently incorporated some of this new functionality into the MySQLGoodies class for PHP. This class is [...]


How fast do your WordPress pages load?

Posted on May 21, 2011 by Jimmy K. in Articles, Tutorials.

This page was loaded in {CurrentLoadTime} seconds! Go ahead, refresh this page and the load time value you just read will change. This is possible because I wrote a WordPress plugin that calculates the time it takes to load a page from start to finish. This is the first plugin I have ever created for [...]


PHP: My preferred MySQLGoodies class.

Posted on May 4, 2011 by Jimmy K. in Articles, Tutorials.

I use a lot of the same functions over and over again for almost every project I work on. A perfect example of what I’m talking about is MySQL-related functions. One day I asked myself, I said, “Self. Why are we hunting for previously-written functions, copying them, and pasting them into the project folder?!” I [...]


AS3: Webcam Upload Tutorial

Posted on April 29, 2011 by Jimmy K. in Tutorials.

In an article on my previous blog, I covered how to take an image with your webcam and upload it to your web server using ActionScript and PHP. This article was always very popular, so I have decided to bring it back to life with updated programming and include it in this new blog. My [...]