views:

121

answers:

4

Aside from the PEAR repository, which I find often has quite messy code with a lot of it using old or deprecated methods and techniques, I was wondering if there was a great place to find simple (and not so simple) PHP examples of some generic functions and good pieces that people have written.

A good example would be the PEAR spreadsheet module I used a while back. The thing worked but it was written quite messily and if I remember correctly, in PHP 4.

I'd like to find something with well written and well documented code that I can refer to and see exactly how people are doing things and why they are doing things that way.

+2  A: 

The PHP manual's as good a place to start as any, I've particularly found some of the comments on there helpful.

There's also The PHP Resource Index, which is mostly a jumping off point to other projects' websites.

Don't forget to look at questions tagged PHP on stackoverflow.

Dominic Rodger
I'm familiar with the PHP manual but that has more examples on different usages of PHP's in built functions... not so much well written specific functions or modules, but thanks.
Evernoob
@Evernoob - I've edited in the PHP resource index, which might be do what you want.
Dominic Rodger
+1  A: 

Have a look at PHP Classes. They have a large selection of classes, all with user ratings.

Skilldrick
If only that website wouldn't cause headaches everytime I have to look at it...
christian studer
A: 

There's also Zend Framework spesific ZF Snippets site

raspi
A: 

Github is another good resource, more often than not it is polished code that is updated frequently.

Getting classes from other people is all well and good but keep upgrade-ability in mind, if i'm using someone else's class and need to tweek it i always extend from it.

Question Mark