PHP book recommendations?
May 12, 2010 7:47 PM   Subscribe

I need to know more about PHP than I do. What book(s) can I buy that will help me do this?

Long story short, I'm a programmer who has just been tasked to take over development of a website coded in PHP. The problem is, I'm not much of a PHP programmer: I can code small toy websites and read the code, but everything I know about PHP comes from w3schools, and that's terribly basic.

This website I've just taken over is larger and more complicated than anything I've done before, and while I can understand what's going on, I feel like it's taking me 10x as long because I just don't have the foundation for this. It took me way too long to figure out that ( ? : ) is shorthand for if-then-else. And then there's the MySQL stuff and the mining-cookies-to-determine-permissions stuff and a whole lot of other things I can understand, in the abstract, but am not nearly good enough to code on my own.

The guy I took over from is too busy to walk me through the niceties of PHP syntax on top of everything else, and this is something I can do on my own anyway, so I'm looking to get a book to help me out. (I prefer books to websites because, while they cost more, having a browser window open tempts me to surf the internets rather than work.) Ideally, I'd like to get a mid-to-advanced PHP handbook aimed at programmers, or a general reference, rather than an absolute beginners' book. I already know some PHP, I just need to be better at it than I am. Much better.

So, hive mind: what do you recommend?
posted by Xany to Computers & Internet (7 answers total) 11 users marked this as a favorite
 
Not to contradict your preferences in reading material, but the best thing would be to simply read through the manual--offline, if it helps. The benefit to this is the discussions appended to the pages of the manual, especially including code samples.

It's not necessary to wade through the library pages, necessarily, and the basic syntax pages are doable in a day or two.
posted by fatbird at 8:19 PM on May 12, 2010


Do you have any background in object-oriented programming? Does the site you're maintaining use any OOP stuff? Here's a good starter book on OOP in PHP, and here's a much more advanced book on OOP in the context of architecture and design patterns. (I have three Apress books, and they're all excellent.)

I know you said you're not looking for websites, but the forums at phpbuilder.com were invaluable to me as a novice.

What kind of background do you have with web development in general? If cookies and SQL databases are new territory for you, then you'll be learning a lot more than just PHP.

It took me way too long to figure out that ( ? : ) is shorthand for if-then-else.

Formally known as the ternary operator, and found in several other languages.
posted by ixohoxi at 8:22 PM on May 12, 2010


Response by poster: My background is mostly C and Python with a bit of Java thrown in - which is also a problem, yeah, as the site is indeed OOP and I'm more familiar with procedural. I know just about enough about cookies and MySQL to handle how they're used in this website, so no problems there. Not many, anyway. The complexity all seems to be on the PHP end.

I'll have a look at those - thanks! Keep the suggestions coming. :)


Formally known as the ternary operator, and found in several other languages.

Aha! So that's what it is! Should've Googled without the brackets, it seems.
posted by Xany at 8:58 PM on May 12, 2010


You're aware of the official PHP site at php.net, right? All of the documentation is there, and is very well documented and organized. I second fatbird: just dive into the manual. (Download it if you want to view it offline.) If you're already comfortable with several other languages, then you mainly just need to pick up new syntax, not new paradigms and concepts.

Pro tip: you can type php.net/functionname into your address bar to quickly look up any function (or any other language feature/construct—for example, http://php.net/cookies).

I'd be happy to answer a question or two if you get stuck—just memail me. I've been coding in PHP since version 3, and have made a living doing it for the last several years, so I can probably help.
posted by ixohoxi at 9:44 PM on May 12, 2010 [2 favorites]


Response by poster: I've browsed the official PHP site and manual, yeah, but I didn't know about the /functionname thing so I was stuck with Googling - that is awesome. That makes it so much more usable.

Cheers, and I may take you up on that yet. :D
posted by Xany at 1:43 AM on May 13, 2010


My favorite, absolute favorite PHP book is PHP Cookbook: Solutions and Examples for PHP Programmers. It's a "getting things done" kind of book.

All of the above books and links are helpful as well.
posted by SoulOnIce at 5:36 AM on May 13, 2010


A lot of good pointers at What is the best PHP programming book?

Also, in general Stack Overflow has a lot of active people who know PHP and a large number of PHP questions that you can learn from.
posted by artlung at 8:57 AM on May 13, 2010


« Older Shady online flight booking?   |   Creating a small site where users upload videos Newer »
This thread is closed to new comments.