Hi everyone,
I have scoured the YC forum for a post on great PHP tricks and best practices, but found nothing. Maybe I'm not looking hard enough, but I would appreciate it if anyone knows of great sites or tutorials. I use CodeIgniter (excellent classes, typical MVC setup) and jQuery (uses a lot of method chaining, huge fan of this). But I still find myself writing a lot of native PHP for my app.
For example, I wasn't aware of the list() function until someone was helping me write a method to convert times. I've noticed when working with another programmer on a project that he's using sprintf() instead, and it surprisingly makes the code a lot cleaner. I'm finding myself doing more algorithm-style methods, dealing a lot with arrays and a bunch of if's/conditionals (tertiary if's are great!).
Just using these as examples, I feel like there should be a cheatsheet of best practices and ways to minimize the amount of native code written somewhere but I'm not seeing it =]
*Edit: I'm going to open up CI's class files and look at how they wrote everything. Perhaps a good way of doing this is to look at other frameworks? Any suggestions there?
http://us.php.net/spl
http://www.php.net/~helly/php/ext/spl/
The documentation on php.net is pretty lacking. Heres are some tutorials and examples:
http://www.phpro.org/tutorials/Introduction-to-SPL.html
http://devzone.zend.com/article/2565-The-Standard-PHP-Librar...