PHP Tutorials

  • By
    Using Weather Data to Change Your Website’s Appearance through PHP and CSS

    A few weeks back, CSS-Tricks.com's Chris Coyier asked me to help him use PHP and the Yahoo Weather API to create a website header that changes based on the weather. Mission accomplished! Skip over to the article and...

  • By
    Custom Error Handling in PHP

    Web application don't always go to plan, that much is obvious. Users will continuously find ways to trigger errors within your application and how you record, contain, and eliminate these errors is a true testament to your code. PHP provides means for trapping errors...

  • By
    Yahoo SEO Domain Result Grabber

    I released my PHP Google Grabber script about a month ago and it was a big hit, even spawning Python and Groovy versions. Obtaining the number of pages indexed in Google by simply providing a domain name...

  • By
    Initiating PHP Sessions Without Sacrificing Your Page Rank

    A while back I had been working on a website project that required an authentication login system. In order for the login system to properly operate every page of my site needed to check to see if there was a session created and the user...

  • By
    Google Grabber — Using PHP to Find Out How Many Pages Your Domain Has Listed in Google

    Most bloggers make an effort to get as many pages listed on Google as possible. Benefits of being listed in Google may include:Increased blog visitsIncreased ad clicksBroadened visitors / audienceIncreased article commentsIncreased referral revenuesUsing a short amount of PHP code, you can query Google to retrieve...

  • By
    PHP DZone Story Information Grabber

    Having a user submit a post to DZone is great for several reasons: A reader thinks enough of what you wrote to want to share it with others. Your blog gets more readership. Your blog revenue increases. The inlink and traffic boost improve your search engine rank and Alexa ranks. The...

  • By
    Increase PHP Memory Allowance Using ini_set()

    On rare occasion, I need to up the memory allowed for PHP. Usually it's when I deal with large files and don't necessarily care about optimizing the file reading process but simply getting the file opened. There's an easy way to increase to amount...

  • By
    Odd Custom PHP Variables

    Creating custom-named PHP variables is pretty easy:But did you know that you can create variables with spaces? The following will work:I can't see any reason to do this, but it's possible.

  • By
    PHP Function To Get A File Extension From A String

    Getting the file extension from a PHP string can be very important in validating a file or file upload. I've written a simple PHP function to retrieve a file extension from a string. The Code This simple method of file extension retrieval should be reused throughout...

  • By
    PHP Redirect Function

    After form submission or a page redirect is triggered, it's commonplace to redirect the user to a different page or to the same page, formatted in a different way. Usually, you'd complete this by coding: This is a completely acceptable way to code your pages, but...