How do you learn PHP?

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

36 Replies - 27162 Views - Last Post: 23 June 2012 - 12:40 PM

Poll: How do you learn PHP? (49 member(s) have cast votes)

Where did you start learning PHP?

  1. Web Tutorials (40 votes [81.63%])

    Percentage of vote: 81.63%

  2. School / University (5 votes [10.20%])

    Percentage of vote: 10.20%

  3. From a Friend (0 votes [0.00%])

    Percentage of vote: 0.00%

  4. From a Book (4 votes [8.16%])

    Percentage of vote: 8.16%

Where do you enhance your PHP knowledge?

  1. Web Tutorials (37 votes [21.14%])

    Percentage of vote: 21.14%

  2. Developer Blogs (19 votes [10.86%])

    Percentage of vote: 10.86%

  3. Books (21 votes [12.00%])

    Percentage of vote: 12.00%

  4. (Forum) Discussions (24 votes [13.71%])

    Percentage of vote: 13.71%

  5. Training Courses (2 votes [1.14%])

    Percentage of vote: 1.14%

  6. Trial + Error (36 votes [20.57%])

    Percentage of vote: 20.57%

  7. The PHP Manual (36 votes [20.57%])

    Percentage of vote: 20.57%

Vote Guests cannot vote

#16 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1004
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: How do you learn PHP?

Posted 22 February 2012 - 10:55 AM

View PostAtli, on 22 February 2012 - 04:07 PM, said:

What, specifically, makes Apache so bad?

I've heard you, and others, make this argument before, but I've never seen anybody actually back it up with facts or references to anything except more random posts/blogs. (Not that I any reason to doubt you. I'm just interested to see the reasons.)

Don't get me wrong it's not that Apache's bad, it's just bloatware in my opinion. Bloatware not in the conventional sense that there's too much for a single offering (although that probably could be true), but bloatware in the fact that it is so resource hungry for the simplest of tasks.

A prime example would be how fast it crumbles under serving a very heavy dynamic workload, hence the requirements for caching proxies on HA offerings.
Was This Post Helpful? 0
  • +
  • -

#17 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,441
  • Joined: 08-June 10

Re: How do you learn PHP?

Posted 22 February 2012 - 11:02 AM

but I donít think, however good or bad Apache is, that it is the webserver that is the reason for bad PHP code. Even if we used nginx or node, crap tutorials are what makes beginners establish bad habits.
Was This Post Helpful? 0
  • +
  • -

#18 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1004
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: How do you learn PHP?

Posted 22 February 2012 - 11:33 AM

No sorry I wasn't getting at that, I had skimmed over most replies to this thread and seen that people kept mentioning WAMP/XAMPP etc and thought I'd respond based on that.

It's definitely crap tutorials that are making the community as a whole bad IMO. Dormi drop me a PM if you want to help out with the series I'm writing, would be happy to send over what I've got at the moment for you to check out. I'm sure you could contribute quite a bit, same goes to anyone else, really.

Disclaimer: Whilst I would love to host what I am doing on DIC, the section here is not particularly suitable for step-by-step tutorials in a click-through format.

This post has been edited by RudiVisser: 22 February 2012 - 11:35 AM

Was This Post Helpful? 0
  • +
  • -

#19 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7999
  • View blog
  • Posts: 13,698
  • Joined: 19-March 11

Re: How do you learn PHP?

Posted 23 February 2012 - 10:06 AM

So, having read through this, are there good tutorials out there that any of the experts would recommend? If there's good stuff among the dross, point it out!

I've been going at it from the trial-and-error-by-fire method - dumped into fixing shit on the company site, I've had to learn on the go. I use any means necessary - books, tutorials, bugging people who know more than I do and asking stupid questions, even checking the language documentation when necessary. (Though for PHP, that's sort of a last resort)

I find that PHP is a weird language to try to learn, since it's so tightly bound to HTML. For a programmer used to "normal languages", it's just a weird way to be. To learn to program C or Java you have to learn to think like the compiler. PHP and the webby languages just don't work that way. To work with them, you have to think like the browser. Usually if I'm stuck, I remind myself of that, and the answer comes to me.
Was This Post Helpful? 0
  • +
  • -

#20 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 948
  • View blog
  • Posts: 2,357
  • Joined: 15-February 11

Re: How do you learn PHP?

Posted 23 February 2012 - 10:29 AM

Since we've got a lot of competent PHP developers on here I think we should start developing the PHP - FAQ, Guides, Resources thread a lot more. Users ask a lot of about user authentication, file uploads, parsing XML etc... but our thread doesn't touch those.
Was This Post Helpful? 0
  • +
  • -

#21 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,441
  • Joined: 08-June 10

Re: How do you learn PHP?

Posted 23 February 2012 - 10:35 AM

View Postjon.kiparsky, on 23 February 2012 - 06:06 PM, said:

So, having read through this, are there good tutorials out there that any of the experts would recommend? If there's good stuff among the dross, point it out!

for webby languages (HTML/CSS/JS) I can recommend A List Apart, though thatís more like insights than tutorials.

for PHP Iíd say anything that doesnít contradict Good Programming Practices (e.g. anything without the mysql extension). I find phpro.org and QuakeNET suitable.


View Postjon.kiparsky, on 23 February 2012 - 06:06 PM, said:

I find that PHP is a weird language to try to learn, since it's so tightly bound to HTML.

It actually isnít. itís just that this is its main use case.

View Postjon.kiparsky, on 23 February 2012 - 06:06 PM, said:

For a programmer used to "normal languages", it's just a weird way to be. To learn to program C or Java you have to learn to think like the compiler. PHP and the webby languages just don't work that way.

Iím quite successful using that technique (thinking like a compiler parser). IMO you can apply that to every language.

View Postjon.kiparsky, on 23 February 2012 - 06:06 PM, said:

To work with them, you have to think like the browser. Usually if I'm stuck, I remind myself of that, and the answer comes to me.

doesnít help for PHP, but for the others (since you could consider the browser as the webby languagesís compiler).
Was This Post Helpful? 0
  • +
  • -

#22 Cbeppe  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 215
  • Joined: 16-September 09

Re: How do you learn PHP?

Posted 30 March 2012 - 08:48 AM

Personally, I learned through web tutorials, starting out with the W3schools site and then moving on to Googl'ing whatever problem I encountered in my applications.

I've been developing websites on and off for about 3 years now and the first mention of PDO I heard was from Dormilich in my contributer thread. That prompted me to read up on more advanced topics of PHP, which in turn lead me to move to PDO and a completely Object Oriented way of doing things.

Point is this though: If you teach PHP as an Object Oriented language, beginners would find that implementing PDO or MySQLi becomes more natural. Speaking from experience, learning OOP was tough, and the only way I really got it through my head was to learn Java.

I have never taken a programming class, but if I was teaching PHP, I would definitely introduce the OOP concept earlier. Once you understand it, integrating PDO into an otherwise functional application becomes much easier to do as well.

- Cbeppe

EDIT: Spelling mistakes

This post has been edited by Cbeppe: 30 March 2012 - 08:49 AM

Was This Post Helpful? 1
  • +
  • -

#23 hiddenghost  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 39
  • View blog
  • Posts: 621
  • Joined: 15-December 09

Re: How do you learn PHP?

Posted 01 April 2012 - 04:48 PM

I would have to agree that online php tutorials that are really good are not as common as the not so good ones.

Though javascript tutorials beat php tutorials largely for bad.

Pretty much with any language I've found there are many good tutorials, but it's all about different aspects in each tutorial.

One place doesn't have everything.
The documentation at php.net is pretty good. Though there isn't so many examples of mixing parts there.

The method of learning for me as far as a source is not so important as long as there are plenty of sources that I check to make sure there's not another way to do one thing.

I focus on the way I learn.
You can read about a sci trial here about learning spoken languages.
http://www.mitpressj...62/jocn_a_00119

Like on that mit page I prefer implicit learning.
With programming I found it hard to use in that context because it's pretty much always applied by writing the code.

To simulate implicit learning like when you would just listen and try to copy what people say be context I had to retool the concept for written language.

In the end implicit learning doesn't reveal all the knowledge needed, but it does create a foundation of intuitively useful knowledge about the programming language.

Here's how I do it.
  • I get a book or find a fairly whole online tutorial about the subject.
  • At the beginning of the book/tutorial I start to copy the code verbatim
  • After each copy I run to see if I copied it correctly.
  • If it doesn't run I alternately read the example I copied from and the copy to see if there are any difference.
  • When the code does run I just move onto the next part of the tutorial.
  • ( This only works if there are whole code examples and not fragments )
  • The whole time I am doing my best to avoid reading explanations of how the code works.
  • Eventually through observing the context I start to derive meaning.
  • It's almost automatic.
  • When I'm finished with most of the tutorial I go back and read through the explanations not copying anything.
  • By now I'm pretty good at making code that works, but probably not really good code. :)
  • From here it's trial and error, going to other tutorials for reference, and asking questions like I do on DIC.

I don't always know when a tutorial is incomplete and has errors, but doing it this way makes the errors and incompleteness stand out for some reason.

The idea is to memorize the most amount of information in the shortest time possible.
It's hard to remember everything if even you read the explanations.
But this method generates an automatic response of understanding while doing the tutorial.
In the end usage in your own projects solidify the information.

I know it's crazy, but that's how I do it. :sweatdrop:
By the time I've become pretty effective at writing a language I probably have more than a couple hundred references if you include all the specific urls for special cases.

It's a lot to keep organized by then, and also a little crazy too. :)

I think it would be premature to say that this method would work for any one. It's mostly my coping mechanism. It helps me deal with how much crap there is, and find the good stuff too.
Was This Post Helpful? 0
  • +
  • -

#24 stevemcgee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-April 12

Re: How do you learn PHP?

Posted 08 April 2012 - 11:23 PM

W3school is best place for online PHP tutorials. It is great site. W3school is the best place to learn PHP in easy way.
Was This Post Helpful? 0
  • +
  • -

#25 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: How do you learn PHP?

Posted 09 April 2012 - 12:31 AM

Now that you've mentioned it, I'm thoroughly unimpressed by W3Schools' tutorials. Besides the claims about their innacuracy and lack of security (which at least when it comes to the two PHP examples there, are spot on), just looking through a few of their first pages about PHP, they don't even seem to bother indenting their code examples properly.

I mean, look at this example, from their page about arrays:
$families = array
  (
  "Griffin"=>array
  (
  "Peter",
  "Lois",
  "Megan"
  ),
  "Quagmire"=>array
  (
  "Glenn"
  ),
  "Brown"=>array
  (
  "Cleveland",
  "Loretta",
  "Junior"
  )
  );


What the hell is this supposed to be? Are they trying to confuse the newbies, or do they just don't care?

How hard would it have been for them to make this a little bit easier on the newbies?
$families = array (
	"Griffin" => array (
		"Peter",
		"Lois",
		"Megan"
	),
	"Quagmire" => array(
		"Glenn"
	),
	"Brown" => array (
		"Cleveland",
		"Loretta",
		"Junior"
	)
);


Not hard at all.


Literally picking a "Advanced" page at random, I come across their mail() function bit. They have two examples, both of which completely ignore the return value of the mail() function. - But hey, why bother teaching them to check if the mail was actually accepted for delivery before printing a success message... right? - Do these people have ANY idea how many topics on forums like DIC revolve around this exact issue? Newbies getting a "Success!" message from their new "contact.php" script, but the email is not delivering. And they have NO clue whatsoever what the problem might be. - And why would they? These awesome W3Schools tutorials -- top of the Google results and all -- would surely show them if there was a simple way to tell if there was a problem sending their mail...


Glancing over their PHP/MySQL tutorial, it doesn't seem to so much as mention the existence of anything besides the old MySQL extension... That's just tragic. No wonder new developers don't seem to know anything about more modern techniques, like MySQLi and PDO, when sites like these occupy Google's top spots for PHP tutorials.


Actually, I think I'm forced to downgrade my previous evaluation of W3Schools. Some of these pages look downright dangerous.
Was This Post Helpful? 1
  • +
  • -

#26 hiddenghost  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 39
  • View blog
  • Posts: 621
  • Joined: 15-December 09

Re: How do you learn PHP?

Posted 09 April 2012 - 02:22 AM

I think I mentioned before that the good tutorials are scattered (not exactly in those words).

One of the things I've noticed is the lack of simplicity in the tutorials that handle less commonly used best practices.

Maybe a collection of simpler tutorials would help.

It's not that the complexity should be ignored, but breaking the tutorials down into smaller parts so they're easier to digest would probably help.

If there are any disparities in a language construct like mysql(not mysqli or pdo) it should be made aware that there are more than one way to do things and results are different for each method.

The fact that there are often the same mistakes being made repeatedly reveals that there needs to be a list of tutorials that focus just on those issues. Kind of like a reveal the mysteries listing where the hard to understand subjects and uncommon ideas are explained in plain Language that's easy to grasp by allowing the reader to visualize the process while learning the better/right way to not make a mistake.

Also the factor of hindsight needs to be a focus, because when you do that thing you thought would be fine it turns out later what you thought was the easy way is the way to debugging hell.

When I first started out I found a lot of easy tutorials, but none really went deep, and the ones that I found later that do go deep are too complex. Sure, after some hard thought I can decipher the examples and explanations, but I'd like to see some tutorials that aren't puzzles in themselves, and still explain the more advanced stuff.

This post has been edited by hiddenghost: 09 April 2012 - 02:25 AM

Was This Post Helpful? 0
  • +
  • -

#27 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3099
  • View blog
  • Posts: 10,885
  • Joined: 08-August 08

Re: How do you learn PHP?

Posted 09 April 2012 - 07:27 AM

I think good tutorials will teach OOP techniques and (related, but not always the same) encapsulation. The problem is that you have little chance of teaching them to some one who's been taught to mix languages like tossing a salad, so the first thing is to dump those tutorials that treat HTML as if it were PHP. The next big emphasis for beginners would probably need to be the difference between server and client. Those two issues account for most of the questions I see in the forum.
Was This Post Helpful? 0
  • +
  • -

#28 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 170
  • View blog
  • Posts: 608
  • Joined: 12-October 09

Re: How do you learn PHP?

Posted 09 April 2012 - 08:24 AM

Interesting that not a single person thinks training courses are of any use.
Was This Post Helpful? 0
  • +
  • -

#29 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3099
  • View blog
  • Posts: 10,885
  • Joined: 08-August 08

Re: How do you learn PHP?

Posted 09 April 2012 - 09:10 AM

In my experience classes can only go as fast as the slowest student. That's fine up through high school since almost everyone is slow, but by college it starts to become a limiting factor and you see more of the work taking place independently the further you go.
Was This Post Helpful? 0
  • +
  • -

#30 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 948
  • View blog
  • Posts: 2,357
  • Joined: 15-February 11

Re: How do you learn PHP?

Posted 09 April 2012 - 11:42 AM

View PostDuckington, on 09 April 2012 - 11:24 AM, said:

Interesting that not a single person thinks training courses are of any use.

Training courses usually cost money and why pay when you have the internet with millions of tutorials and guides?
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3