PHP Tutorials

  • By
    WordPress, 404s, and Load Time

    It's no secret that my website tends to get slow during high periods of traffic and I believe I identified one of the big problems. I've found that one of the plugins I use has an incorrect ".css" reference that is 404ing. That means...

  • By
    Create Digg URLs Using PHP

    Digg recently came out with a sweet new feature that allows users to create Tiny Digg URLs which show a Digg banner at the top allowing easy access to vote for the article from the page. While I love visiting Digg every once in a...

  • By
    Update Your Twitter Status Remotely Using PHP

    The reason Twitter is so hugely popular is because their API allows for you to do almost anything. Here's how you can tweet remotely using PHP. The PHP That's it! Note that you may direct Twitter to return a XML or JSON response. Here's what...

  • By
    Prevent Your CSS and JavaScript Files From Being Cached

    Some websites use highly volatile, oft-changing CSS and JavaScript files. In the case of these files, it's important that the developer prevent browsers from caching them. How do we do that? By using a phantom querystring, of course. We'll use PHP to...

  • By
    Backup Your Database into an XML File Using PHP

    Backing up data is extremely important. Most of the time the database is the most important piece of the puzzle. Imagine losing all of the data in your database -- it would be tragic. Here's a PHP snippet that outputs your database as...

  • By
    iPhone & iPod Detection Using JavaScript

    I was browsing the ESPN.com source code recently and stumbled upon their method of detecting iPhone / iPod touch users and redirecting them to their iPhone-compatible website. The JavaScript The code itself is short and sweet. I, however, would prefer using the server-side method of user agent...

  • By
    Animated AJAX Record Deletion Using MooTools

    I'm a huge fan of WordPress' method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here's how to achieve that functionality with MooTools JavaScript. The PHP - Content & Header The following snippet goes at the...

  • By
    Linkify Your Twitter Feed

    So, you want to display your Twitter status on your blog? No problem, use the API. But, what if you want to display links in your status like twitter.com itself does? No problem, use regular expressions. Here is a function that will turn all HTTP URLs, Twitter @usernames...

  • By
    Read PDF and Word DOC Files Using PHP

    One of my customers has an insane amount of PDF and Microsoft Word DOC files on their website. It's core to their online services so it's not as though they're garbage files up on the server. My customer wanted their website's search engine (Sphider)...

  • By
    Create an Is.Gd URL Using PHP

    Is.Gd is a URL-shortening service much like TinyURL. Using PHP's cURL library, you can create shortened URLs on the fly with ease. The PHP "is.gd" is much shorter than "tinyurl.com" so if you need the URL to be as short as possible, use this method.