Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php oop



8:43 pm on Jun 1, 2010 (gmt 0)


On this site I found a lot of cool examples of PHP OOP. Maybe you know where to find complete examples? Guest books, registration forms, blog...

When I look at the full model is much easier to understand OOP PHP. As different classes interacting with each other, exchange data How to use the generic class for sending data to the database



9:08 pm on Jun 1, 2010 (gmt 0)

5+ Year Member


You might be better off trying out a PHP framework like Cake, Symphony or Zend.


2:42 am on Jun 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

The book PHP 5 Objects, Patterns, and Practice by Matt Zandstra was something I found quite useful.


11:42 am on Jun 3, 2010 (gmt 0)

5+ Year Member

class One {
function one_func(){
return 'hello';


class Two {
function two_func(){
return 'world';

//to access the functions of the above classes assuming they r on the same page
$one = new One();
$two = new Two();
print $one->one_func().' '.$two->two_func();


12:06 pm on Jun 3, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Hi there Lolalola,

I too am just starting to learn OOP, and am finding it quite alot of fun, especially when it works. For places of reference php.net is the best place as a start point - but we all have our different ways of learning. I started php years ago, and decided to learn OOP when I had got the hang of just writing a script, and honing it to function better so that the background experience would pay off when trying a new way of structuring a site. I'm glad I made that choice.

One thing to be wary of is the differences between the PHP4 and PHP5 class engine/structure, as this has caught me out a few times in the last day or two.

My advice: Start with something simple, learn how things are structured, and see how they interact - see what happens when you change var types etc - this is how I have gone about it.

There are a few decent books out, just depends on how much you are willing to pay.

Have fun with whatever you decide to go with.

Good luck!


Featured Threads

Hot Threads This Week

Hot Threads This Month