Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tutorials:
Intro to Objects, and Threading
Jul 19, 2002 @ 11:22:44

There's two new tutorials that were found this morning, the first from the O'Reilly Network. Introduction to PHP Objects, Part 1 dives into the wonderful world of PHP objects and how to use them in your scripts. They show you how to create sample classes, reference itself from inside itself, and even how to use and declare functions within that class. Classes are one of the more powerful parts of PHP, and, if you haven't learned them yet, trust me - you'll want to. There's so many more things that you can do with a shared code library that is just so much more complicated when you use separate files for everything. This article is just the beginning, too! There's so much more that this out there waiting...

Also on the tutorial from this morning, we have one from the Axion-Network.net that talks about using recursive threading with PHP and MySQL to create a threaded discussion for a website. This tutorial gives you everything that you'd need to know, including the database table structure and the various scripts to help you post, list, and manage the postings on this message board. The whole key to this all is one function (thread) that calls itself when it finds that there are replies for that topic - a sort of parent-child relationship between them. This tutorial is one of the first I've seen in a long time that deals with recursive functions. They're such a cool idea, and so many people could use them on things like this rather than having to just call the function in a loop over and over. Even our own comments system uses something similar, and it's nice and fast too.

tagged:

Link:


Trending Topics: