3

I'm pretty good with PHP, but the one thing I've never understood completely is classes. I've used a few (such as class.upload.php) but have fumbled my way around and more out of a monkey see monkey do approach.

Can anyone point me to some good tutorials that explain how these suckers work and how they function? I'd really appreciate it!

Thanks in advance

TH1981
  • 3,105
  • 7
  • 42
  • 78
  • PHP 5 Objects, Patterns, and Practice by Matt Zandstra is possibly one of the best PHP related books you can read. Yes, I said best. Feel free to condradict me, I will argue its case till hell freezes over. – Russell Dias Sep 24 '10 at 02:20
  • possible duplicate of [Learning PHP Class](http://stackoverflow.com/questions/2206387/learning-php-class) – Gordon Sep 24 '10 at 06:58

3 Answers3

4

Nettuts: Object-Oriented PHP for beginners

That's a good startting point. They have a lot of these tutorials actually. Also a good idea is, to just go to your bookstore, and see what's lying around there.

I still prefer actual paper to screen reading. Also makes it easier to annotate.

The rest will come with time. After you understand the basics, it would be a good time to further read into OOP design patterns. Start with the singleton, as I feel like that is the easiest to grasp.

http://www.informit.com/articles/article.aspx?p=346958&seqNum=4
http://net.tutsplus.com/articles/general/a-beginners-guide-to-design-patterns/

Tilman Koester
  • 1,739
  • 2
  • 11
  • 25
1

Tutorials won't help you. I'm exactly where you are, but found out that tuts really don't tell you the why and what of things. Only the How.

I really recommend you buy a book. Prentice Hall PHP Power Programming is one excellent book.

Aditya M P
  • 5,127
  • 7
  • 41
  • 72
  • I did originally learn php from a couple of books, but they were basic and skipped classes altogether. Unfortunately, I live in the middle of nowhere and so my nearest decent bookstore is a couple of hours away. I've never been one for ordering a programming book without having a proper thumb through. will look up PHP Power Programming though - thanks for the recommendation! :) – TH1981 Sep 24 '10 at 02:20
  • @Aninemity: On the topic of books, check out O'Reilly's PHP Cookbook. It's amazing and has quite a few examples. http://oreilly.com/catalog/9780596101015 – Geekster Sep 24 '10 at 03:08
1

www.php.net has awesome resources for these types of things: http://php.net/manual/en/language.oop5.php

ItsPronounced
  • 5,475
  • 13
  • 47
  • 86
  • aha! I use php.net all the time as a reference, but have never found anything decent on classes. Cheers! – TH1981 Sep 24 '10 at 02:18