PHP intro and reference texts?
June 10, 2008 12:03 AM   Subscribe

I want to learn PHP. Fast. Recommend a book or online resources, please.

I know C, C++, Java, SQL. I know my Design Patterns, most of the stuff in Code Complete is second-nature to me. I emailed Stroustrup to point out a (very very minor) error in The C++ Programming Language. (He actually emailed back.)

All this to say that I want an thorough explication of PHP, not an introduction to programming text. There should be chart of operator precedence and arity, a list of what's a first class object, a consideration of the primitive types and their ranges, a basic explication of the underlying object model.

So I don't want a "Programming 101 using PHP"; that'll bore me with stuff I already know. I need something complex enough to keep my interest, complete and concise. But not completely theoretical, there should be examples and exercises. Something like K&R or Stroustrup's The C++ Programming Language, that doubles as a text and a reference. Or even Eckel's Thinking in C++.

Ideally, I should be able to do most things I want to do in PHP in a week.

Ok, suggestions? Thanks!
posted by orthogonality to Computers & Internet (12 answers total) 6 users marked this as a favorite
 
Consider taking a look at the www.php.net reference. There's lots of detail about classes. When you're browsing functions, scroll down for code snippets and usage gotchas.
posted by Blazecock Pileon at 12:36 AM on June 10, 2008


Yep, http://www.php.net/ is pretty much all I used.
I knew C/C++ going into PHP as well.
PHP is easy like C, but with some of the niftyness that Java has.
posted by jammnrose at 12:40 AM on June 10, 2008


3rding the language reference. It's fairly thorough but understandable. The PHP 5 object model is also more or less directly lifted from Java's, though with clunkier syntax.
posted by Zarkonnen at 2:06 AM on June 10, 2008


Really, if you know all that stuff already, I'd third just going straight to the php.net reference material. 99% of PHP will be immediately obvious to you, although there are a few quirks here and there.

I picked up a pretty thorough understanding of the language inside a week, entirely on the basis of 'learning by doing' and periodically heading back to the php.net site.
posted by le morte de bea arthur at 2:12 AM on June 10, 2008


Hey, that 'third' was mine. Give it back.
posted by le morte de bea arthur at 2:13 AM on June 10, 2008


Yet another suggestion here for php.net, especially if you're a coder already. Also Tizag has some decent reference pages and tutorials, which I found helpful in picking up PHP.
posted by a lunatic at 6:47 AM on June 10, 2008


I have a similar background, but nowhere near the depth that you do. By perusing php.net, I went from zero to incorporating a variety of php xml-parsing utilities into a couple of web sites. It only took a a number of hours. I would just set aside a week and try to whip up some web site app you have been thinking about.
posted by mzurer at 7:07 AM on June 10, 2008


Nth.

You will find that hitting the raw documentation is the only way of getting good information about PHP. Because it's so "easy" to use, PHP attracts non programmers and so essentially all of the documentation is written from that angle. A glance at the comments of say the floor() function illustrates that nicely.

You'll have a much better time looking at the function reference and maybe a good codebase (symfony). Sadly PHP is not thoroughly explicated anywhere at all, including the source code so these are all half-measures.
posted by Skorgu at 7:32 AM on June 10, 2008


I think you're expecting a lot more order and structure from the PHP language than you should :)
posted by xmutex at 7:59 AM on June 10, 2008


I haven't used it to learn PHP yet, or any kind of code, but Lynda.com sure has brought me up to speed on software in a hurry. I've had a great experience with the video tutorials there.
posted by bristolcat at 8:47 AM on June 10, 2008


I think you're expecting a lot more order and structure from the PHP language than you should :)

It is possible, although difficult, to create a good PHP application. The problem is that there is so much PHP 4 legacy code from the non-OO days.
posted by Blazecock Pileon at 10:42 AM on June 10, 2008


PHP does, for all its shortfalls, have a phenomenally good manual, as has been pointed out. (For example: Operators, with explicit precedence explanations) With the function list and your prior knowledge of various curly brace languages, and design patterns, you should already be in a good position to build whatever you crave.
posted by Smoosh Faced Lion at 1:09 PM on June 10, 2008


« Older What's the oldest version of Photoshop that works...   |   What are the alcohol content(s) for different... Newer »
This thread is closed to new comments.