I'm interested to find out what Stack Overflow believes the best PHP book is - both for those who are beginners to web programming as well as those who have previous programming experience (they don't have to be same book). "Best" includes being both reasonably up-to-date and encouraging best practices for secure, modern, PHP programming.
There seems to be a lot of books out there and unlike other languages there doesn't seem to be a single well-regarded book and it's hard to separate the wheat from the chaff, so I'm interested to see what the community believes is good - both for personal use and for future recommendation to others.
To clarify: I know of the PHP manual which is largely a reference, not paper, makes little comment as to proper style and is not what I'm looking for.
I'll second (or third) " PHP Objects, Patterns, and Practice [1]" by Matt Zandstra (get the newer 3rd edition) as one of the best books on OOP ever, not just on PHP. I recommend it to everyone moving to PHP from another language, or anyone new to OOP.
Another great object-oriented programming reference is Bruce Eckel's " Thinking in Java [2]" which you can download for free on the web. Yes, I know, it's not a PHP book, but most of the same principles apply, and you can translate most of the examples in the book from Java to PHP > 5 in little time since PHP5's object model is so much like Java's (with some interesting differences).
[1] http://rads.stackoverflow.com/amzn/click/143022925XPHP In Action [1]
Covers pretty much every modern web development topic including:
One of the best programming books I've read even though I knew most of that stuff anyway, and I imagine one of the best introductions to OOP for any experienced PHP developer out there wanting to get out of the procedural rut.
[1] http://www.manning.com/reiersol/I'd recommend that every PHP programmer reads Essential PHP Security By Chris Shiflett [1]
[1] http://oreilly.com/catalog/9780596006563/I like Schlossnagle's Advanced PHP Programming [1]. It's a great reference with good worked examples for things like session handling, RPC, unit testing, caching, profiling and even extending the language engine. If you already know PHP and are using it for a large project it is a very useful book to have around.
[1] http://rads.stackoverflow.com/amzn/click/0672329239Here is top List
Developing PHP Applications for IBM Data Servers [1] | IBM Redbooks Published in 2006, 448 pages
Doctrine ORM for PHP [2] Jonathan H. Wage, Konsta Vesterinen | Sensio SA Published in 2010, 373 pages
PHP 5 Power Programming [3] Andi Gutmans, Stig Bakken, Derick Rethans | Prentice Hall PTR Published in 2004, 720 pages
PHP Cookbook [4] Adam Trachtenberg, David Sklar | O'Reilly Media Published in 2006, 810 pages
PHP Essentials [5] | Techotopia Published in 2008
PHP Functions Essential Reference [6] Torben Wilson, Zak Greant, Graeme Merrall, Brett Michlitsch | Sams Published in 2001, 768 pages
PHP Reference: Beginner to Intermediate PHP5 [7] Mario Lurig | Lulu.com Published in 2008, 164 pages
PHP Security Guide [8] | PHP Security Consortium Published in 2005, 37 pages
Practical PHP Programming [9] Paul Hudson | Published in 2007
Practical PHP Testing [10] Giorgio Sironi | Published in 2009, 61 pages
Super Awesome Advanced CakePHP Tips [11] Matt Curry | PseudoCoder.com Published in 2009, 66 pages
The Definitive Guide to symfony [12] Fabien Potencier, Fran�ois Zaninotto | Apress Published in 2007, 425 pages
The Oracle PHP Cookbook [13] John Alphonse, Justin Kestelyn | Oracle Published in 2009
The Underground PHP and Oracle Manual [14] Christopher Jones, Alison Holloway | Oracle Published in 2008, 290 pages
Zend Framework: Surviving The Deep End [15] P�draic Brady | Published in 2009, 37 pages
As others said, PHP Objects, Patterns, and Practice (2nd edition) [1] is a good start point if you're developing in PHP, but if you haven't read them, I'll go back to the fundamentals. First Design Patterns: Elements of Reusable Object-Oriented Software [2] by the Gang of Four to learn the common patterns (decorator, composite, facade, singleton...) in software development (some of them are also explained in "PHP Objects..."). Then Patterns of Enterprise Application Architecture [3] by Fowler which extends the basic patterns to create more complex patterns like MVC.
Then you could also take a look to some of Misko Havery videos, like Design Tech Talk Series Presents: OO Design for Testability [4]. He is the Agile Coach at Google and his videos about testing are really illuminating not only in why you should code for testability but also why you should do OOP.
By that moment you will realize that your code is not so good and you'll thing about refactoring. The Refactoring: Improving the Design of Existing Code [5] also by Fowler is considered the bible for refactoring, but I prefer Working Effectively with Legacy Code [6] by Michael Feathers.
[1] http://rads.stackoverflow.com/amzn/click/1590599098I've always liked O'Reilly's titles, so I'd recommend their Programming PHP [1] book. It's authored by Rasmus Lerdof, PHP's creator, along with other PHP industry experts, so it could be considered pretty authoritative.
[1] http://oreilly.com/catalog/9780596006815/I tend to learn by doing, so I enjoyed the O'Reilly PHP Cookbook [1] and of course the php.net manual (if you download the windows chm, be sure to get the extended version with comments)
[1] http://rads.stackoverflow.com/amzn/click/0596101015Personally, I like the SitePoint [1] PHP books. I read them, they are really nice and can be used "out of the box".
And then of course the PHP manuel (mostly for searching for some functions):
Larry Ulman's PHP5 Visual QuickPro Guide [1] is what helped me get started in my progress from a hobbyist to a professional developer some eight years back (well, it was an older edition, not this one exactly). You wouldn't expect it from the title, but it's actually well-written, very readable, and very usable for a beginner, without descending into talking-down or dumbing-down the material. Check the amazon reviews for it and subsequent editions.
Looking at publishers, Apress [2] and Pragmatic Programmer [3] books in general are usually pretty good, not to mention O'Reilly [4]. I hear Peachpit Press [5] puts some good quality stuff out too, but I don't have any of their titles, so can't speak with confidence to that.
Oh, and Safari Books [6] has a really cool subscription program where you get unlimited access to a huge number of technical books from O'Reilly and a bunch of other publishers online.
[1] http://rads.stackoverflow.com/amzn/click/0321376013This isn't a pure PHP book, but the book that did influence how I write php code the most is "Patterns of Enterprise Application Architecture" by Martin Fowler [1]. It's a nugget of gold for someone that wants to learn to structure and develop object oriented code in a languages such as PHP, Java, C#.
[1] http://rads.stackoverflow.com/amzn/click/0321127420PHP objects patterns and practice, http://www.apress.com/book/view/9781590599099 its the best programming book I ever read.
I would suggest PHP Object-Oriented Solutions by David Powers
PHP Object-Oriented Solutions [1]
* Teaches the fundamentals of OOP (Best Explanation on OOP)
* Simple projects show how OOP concepts work in the real world
* Pre-packaged scripts can easily be added to your own projects
What youll learn
* PHP features, such as the Standard PHP Library (SPL), that are poorly documented or ignored by existing books
* How to develop classes of their own
* OOP in easy-to-understand language without getting bogged down in dense theory
* Solid foundations for developers wishing to delve more deeply into OOP
* How to leverage the strengths of OOP as a means for creating reusable code that can be used successfully within a procedural context
* How to code for both PHP 5 and 6
[1] http://rads.stackoverflow.com/amzn/click/1430210117For absolute beginners I'd recommend Head First PHP & MySQL [1]. It shouldn't be the last PHP book you read if you want to be a professional web developer, but it covers all the basics so it's a good place to start.
One aspect of the book that I really enjoyed was the attention to basic security concerns. It starts off with a very simple site design, then shows how an attacker might exploit the weaknesses of that design and what you can do about it.
[1] http://rads.stackoverflow.com/amzn/click/0596006306Of course it depends on your requirements. If you've gotten to grips with the syntax, and you're looking to develop larger applications, or, you're looking to really harness the OO approach of PHP5, I'd reccomend the Matt Zandstra book:
http://www.amazon.com/gp/product/1590593804/ref=cm_cr_pr_product_top [1]
It really cements the fundamental aspects of application development, and, goes great with the new Zend Framework (which I'd also recommend).
Andrew
[1] http://rads.stackoverflow.com/amzn/click/1590593804For an in-depth view on PHP5 I'd recommend (besides the other honorable mentions in this thread):
PHP 5 Power-Programming [1] from Andi Gutmans, Stig Sæther Bakken and Derick Rethans
Zend PHP 5 Certification Study Guide [2] from Davey Shafik and Ben Ramsey
My choice is http://php.net/manual/en/ It contain very useful user comments on every page. For best practices I recommend read manuals for various PHP frameworks and libraries (like symfony or Propel) because PHP itself is not a “well-formed” language and such great tools will help you to learn best ways of writing of PHP code.
I think the best book for PHP is "Programming PHP" [1] published by O'Reilly and written by Rasmus Lerdrof. although I liked "PHP & MySQL bible" [2] published by John Wiley, but "Programming PHP" was more effective whilst it had less pages.
[1] http://rads.stackoverflow.com/amzn/click/0596006810I always loved Julie Meloni's books
http://www.thickbook.com/phpess2_toc.html
this was one of the first books on PHP that I actually purchased.. very easy to understand
For a language reference, it's really hard to beat the website - it's also quite easy to get a local mirror of the relevant manual section for yourself.
Most of the rest of what you need to know is covered by other software engineering texts, like use of testing, or refactoring.
Pro PHP Security [1] is one of the best PHP books I've read in a while.
[1] http://rads.stackoverflow.com/amzn/click/1590595084Personally I hve recently read "Pro PHP: Patterns, Frameworks, Testing and More" by Kevin McArthur (ISBN: 9781590598191). Out this year so pretty up to date. Excellent source of info for those who want to expand their knowledge of PHP.
Try
link text [1]
Or other book by the same author or indeed publisher.
[1] http://rads.stackoverflow.com/amzn/click/032152599XPHP in Action is one book i DONT recommend for someone who wants to learn pure php. Neither does it cover simple php constructs, neither does it cover any advanced topics about php. Anytime you feel that an interesting/advanced topic has started, it stops there and starts off with something else. There is only mention of patterns, OOP concepts, Agile concepts etc etc that you can read off from some book dedicated to the subject.
What a waste of money considering the fact that the last 3 "... in Action" books that i have ready have surely turned out to be the best references on the topic they talk about.
Really different topics of books. I have Programming PHP by Lerdorf which I can say deals with the basics of the language and is propably great if you have to know the language. I wolud recommend for anybody who's not an advanced PHP coder to read Gilmore's Beginning PHP and MySQL from Apress. It has lot's of great content and covers a lot.
I have to say that "Practical Web 2.0 Applications with PHP" was one of the most useful books i ever read. It really improved my skills. [Spam link removed]
A good solid reference manual is a great tool especially if it has practical, real world examples, rather than the sterile classroom ones which don't really match the design you need for your site / app / script. Heres a couple of good ones :
To start with PHP MySQL eBook [1]
[1] http://3dbbcao8vgzr3p418b2f1g08zr.hop.clickbank.net/?tid=TCA
Core PHP Programming
[1] Third Edition for PHP 5
by Leon Atkinson with Zeev Suraski, PHP 5 contributer and Zend Engine 2 co-creator
This is one of my favorite PHP books of all time.
[1] http://rads.stackoverflow.com/amzn/click/0130463469I learnt all the basics of PHP from a book calld "PHP 5 in easy steps" its a really good, well written beginners guide to getting started and covers the things you got interested in PHP to begin with, such as form processing, sending emails, mySQL, OOP basics and the basics of PHP (and any programming language), arrays, variables, loops etc.
Definatly recommend. I borrowed from a Higher Computing teacher and he never got it back :P
Read php book written by O'Reilly
Lots of books are there from basics to adnavced like Learning PHP 5, php cookbook etc.. written by O'Reilly
I think, the most appropriate answer to this totally depends on what stage you are right now on your skill in programming or PHP itself. By the time you get alot of answers, you might just get confused with all the recommendations out there and might not choose anything at all. All books have their own style of writing or atmosphere that affects the readers' absorption of knowledge. So what might be great for one person might be the worst book ever for another. It is highly subjective.
Most times i prefer to learn a language as i develop a project, that way what i read sticks to me for a long time. So in cases like that, it would be better for me to scour google instead of flipping through pages on a book because chances are, what is printed on the book might be deprecated and the delivery was not very clear to the reader.
But anyways, here are some books that i recommend:
Good times man! Hope you find that book :D