Hey hackers,
I've a background in C#, Java and JavaScript but don't know a thing about PHP. Couple of questions
a) How do you recommend I should go about learning PHP?
b) Any recommended Editors (I've to use Windows)?
c) I spent sometime looking for frameworks and CodeIgniter seems promising. Your thoughts?
Any other tips, books, libraries, frameworks and goodies you would recommend? Any help is highly appreciated.
- Recommend Editor: "Eclipse PDT" [1] probably has the best tools relating to PHP development, although I just use Vim for all of my PHP work.
- Bookmark the PHP online manual [2], and add their search plugin to Firefox, so you can look up standard library functions just by typing it into the search bar.
- The Zend Framework [3], more of a great library than a traditional framework, is probably the best resource for any projects your may be starting from scratch, although CodeIgniter is definitely a top contender.
Probably the best way to learn PHP itself is to read the (rather well-done) PHP manual, which includes everything from an introduction to the language, it's parsing and syntax trees, all the way up to how its object model works, and complete references for the entire function library, and all standard modules.
Read some source code from the wild. I suggest Mediawiki and Drupal.
Key points to make sure you understand:
- Arrays are the archetypal datatype in PHP, and can be used as lists, dictionaries, or a mix of the two.
- You can do just about anything just by using the standard function library. Frameworks are not necessary, contrary to popular belief.
- Objects are a mishmash of arrays, structures, and standard C++/Java objects. You can add class variables, functions, and such at runtime.
- You can do a lot of "fancy" meta-programming in PHP; you just have to know how to accomplish what you want. The PHP library helps out a lot with this.
- Everything is a template. It may be a bit more verbose than compiled templating dialects, but PHP itself is a really handy templating system in it's own right, just using <?php and ?> tags.
[1] http://www.eclipse.org/pdt/
[2] http://www.php.net/manual/en/
[3] http://framework.zend.com/