|
Posted by Erwin Moller on 03/20/06 14:05
Shelly wrote:
> I know C, C++ and Java. I have been using "procedural" PHP. I get the
> list of classes for PHP, but I need a "PHP OOP for Dummies" on how to
> implement
> these. Any pointers to a tutotial?
>
> Shelly
Hi Shelly,
For starters:
http://nl2.php.net/manual/en/language.oop.php
It covers all basic usage.
If you are familiar with OOP, which you are since you did C++ and Java, PHP
classes and OOP should be easy.
Remember that PHP is used mostly in webpages, and all objects should be
created within a 'pagesession', and die when request is finished (unless
you take certain precautions).
If you need them to live longer, you'll have to serialize them, store them
somewhere (eg database or $_SESSION), and revive them where needed.
Things like J2EE's ServletContext doesn't exists in PHP, as all runs in a
per-request fashion.
Hope that helps a bit.
I think you'll have an easy time coming C++ and Java. :-)
Good luck and regards,
Erwin Moller
[Back to original message]
|