How do you learn PHP?

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

36 Replies - 27228 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

#1 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3577
  • View blog
  • Posts: 10,444
  • Joined: 08-June 10

How do you learn PHP?

Post icon  Posted 20 February 2012 - 07:33 AM

Though nearly 5 years out of service support, the mysql extension seems still omnipresent. Personally I am of the opinion that the reason is grounded in the way PHP (and many of the Web Development languages) are taught to people. So I wonder how we can change it to the better. Personally I think that it would be necessary to flood the web with better-quality tutorials, but I am aware that this is an option difficult to carry out.

But since I'm at this point I'd like to know how you started learning PHP? (maybe I'm just assuming too much but there's nothing better to figure things out than by asking the people who know it--you--about it)

Is This A Good Question/Topic? 4
  • +

Replies To: How do you learn PHP?

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3105
  • Posts: 10,903
  • Joined: 08-August 08

Re: How do you learn PHP?

Posted 20 February 2012 - 07:49 AM

Although I use web tutorials I agree that on average they're not very good. Many are horrible, but I think previous training in other languages helps to weed out the garbage. If you're already approaching the language thinking about organization then the bad ones are obvious. That doesn't guarantee you'll know what's out of date, but the bad ones will tend to be out of date too.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6111
  • View blog
  • Posts: 23,671
  • Joined: 23-August 08

Re: How do you learn PHP?

Posted 20 February 2012 - 07:55 AM

I'm too old for there to have been much in the way of web tutorials :) I started way back with PHP3, when I was tasked with writing extensions to PHP (in C and C++) to support the web designer. At that point I was simply writing very simple test scripts for unit testing the extensions.

There are WAY too many really shitty tutorials with high Google rankings that are polluting the environment. It would be nice if there were some way to remove them from the landscape, but unfortunately that seems an insurmountable task at this point.
Was This Post Helpful? 1
  • +
  • -

#4 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5413
  • View blog
  • Posts: 27,429
  • Joined: 10-May 07

Re: How do you learn PHP?

Posted 20 February 2012 - 08:02 AM

I actually tried to avoid php, as I was still using perl, shell, & C with cgi-bin for things that html couldn't do. A friend urged me to give php an honest try, & with plenty of referencing from php.net I was able to pick it up.

Though I will disagree with your php/mysql statement. I believe what really keeps them together are wamp & lamp.
Was This Post Helpful? 0
  • +
  • -

#5 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 20 February 2012 - 10:05 AM

I started out in school but we didn't reach as far as database interactions. I started with the mysql extension because of online tutorials and such. Most of the online tutorials honestly need updating but a lot of people don't check the date before diving into content. I got into Prepared Statements I think from another online tutorial but that was MySQLi and then learned PDO from here. PHP 5 Power Programming was a good book that helped me fill in a few gaps that weren't covered in the online tutorials.

To get our tutorials ranked higher we as authors should take SEO into consideration in my opinion. I don't have much experience or knowledge in it but for those that do should pitch a few tips around.

I just wanted to add that w3schools.com has a big influence on beginners as well.

This post has been edited by codeprada: 20 February 2012 - 10:10 AM

Was This Post Helpful? 0
  • +
  • -

#6 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 801
  • View blog
  • Posts: 1,700
  • Joined: 30-January 09

Re: How do you learn PHP?

Posted 20 February 2012 - 02:37 PM

I have to agree with no2pencil about this. I've recently been going through the painful migration from MySQL to PostgreSQL, as Pg has features that My simply doesn't have. I couldn't get Pg working easily on WampServer, so I went fishing around for another package install, and couldn't find any that had Pg shipped as default. I eventually went with EasyPHP and hooked in Pg with the help of a French blog on how to do it. Thank heavens for Google Translate.

I learnt via W3Schools initially, then I started trying things out, and eventually got to asking questions here. Nowadays, I'm answering more than I'm asking, but I'm still pretty low on the learning curve - I see some answers by other PHP coders and realise that I need to study the manual a lot more. Still, it's the same questions coming up time and again.

As far as web tutorials go, I'm not sure how other people look for them, but I generally distill my problem down to a single issue (e.g. - how do I RegEx replace an array into a template). Once I get my core issue boiled down, finding the answer is easy. I think some other people (read: newbies) want a page and a half of code already written for them that they don't have to think about.

I think the tutorials and snippets sections here could do with a bit better organisation. I'm not sure how to reorganise, but it is a bit overwhelming when I go looking in there - there's a lot of good material, but it can be hard to find unless you know what you're looking for.
Was This Post Helpful? 1
  • +
  • -

#7 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3577
  • View blog
  • Posts: 10,444
  • Joined: 08-June 10

Re: How do you learn PHP?

Posted 20 February 2012 - 03:04 PM

View Poste_i_pi, on 20 February 2012 - 10:37 PM, said:

I couldn't get Pg working easily on WampServer, so I went fishing around for another package install, and couldn't find any that had Pg shipped as default. I eventually went with EasyPHP and hooked in Pg with the help of a French blog on how to do it.

thank god I don’t develop on Windows, so I can just install it from the repository.
Was This Post Helpful? 2
  • +
  • -

#8 Slice  Icon User is offline

  • sudo pacman -S moneyz


Reputation: 245
  • View blog
  • Posts: 719
  • Joined: 24-November 08

Re: How do you learn PHP?

Posted 20 February 2012 - 06:25 PM

Some of the basics are where the old, outdated tutorials flurish. You get someone (like myself not too long ago) googling how to upload a file to a server.

All the tutorials you find are using mysql_connect and mysql_query, so naturally you assume you're on the right track. No one has told you otherwise so you continue down that path, following more and more outdated tutorials until eventually you want to try something a little more complex.

And that's when you head over to dreamincode.net, and get slapped hard around the face with a reality check by either Dormilich or CTphpnwb that your code is wide open to security intrusions and everything you thought you knew is garbage.

...At least that's how I remember it. :)

This post has been edited by Slice: 20 February 2012 - 06:26 PM

Was This Post Helpful? 1
  • +
  • -

#9 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6111
  • View blog
  • Posts: 23,671
  • Joined: 23-August 08

Re: How do you learn PHP?

Posted 21 February 2012 - 04:16 AM

But there ain't no one who "slaps you around" more lovingly than Dormilich...and Atli :)
Was This Post Helpful? 2
  • +
  • -

#10 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: How do you learn PHP?

Posted 21 February 2012 - 08:36 AM

I am no expert in PHP, almost everything I have learned has come through trial and error (using php.net a lot) and Wordpress development.
Was This Post Helpful? 0
  • +
  • -

#11 aklo  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 229
  • Joined: 23-January 09

Re: How do you learn PHP?

Posted 21 February 2012 - 09:44 AM

I forgot where I learnt php but the site taught me something like this (this is not the actual site), creating class for database or class for things that you will use repeatly, some php syntax
I create a little blog like website to learn about database connection and retrieving data from mysql , pagination with php thats about all I can do basic stuff which are actually good enough to make a website and I thought i'm pretty OK with php.

However later on I'm required to do a project using Joomla and I needed custom extension and I realise I don't know a lot about PHP...also because i'm not that familiar with the Joomla framework.

Those are like 2years back and I didn't touch php since then.

As for security stuffs there is always google/DIC to search for a list of security things that you need to do to your sql queries, user input. I only know about sql injection that's about it.

I also heard of various php framework and I used code igniter for about 3 days ...I can't get use to going "this folder, some config file, enter database name, hostname etc..."

Maybe if i'm actually working and require more in-depth knowledge then i'll start to look deeper ...till then i'm going to learn asp.net mvc first.


Edit: Installing php, mysql , apache is a PITA, some guides talk about changing the environment variables while some didn't...in the end I used WAMP.

This post has been edited by aklo: 21 February 2012 - 09:48 AM

Was This Post Helpful? 0
  • +
  • -

#12 Curtis Rutland  Icon User is offline

  • (╯°□°)╯︵ (~ .o.)~
  • member icon


Reputation: 4577
  • View blog
  • Posts: 8,019
  • Joined: 08-June 10

Re: How do you learn PHP?

Posted 21 February 2012 - 10:42 AM

*
POPULAR

For some reason, some people like to put out a massive volume of shitty advice and tutorials. I think that they think the more they get their name out there, the better. Like, when a potential employer googles them they're going to be like "holy crap, this guy has articles everywhere!" So they dump their ultimately shitty knowledge everywhere they can, and it basically works.

So the guy googles the quintessential question "how do I get data from my database onto my page." 1,000,000 hits. So he just starts working his way through, creating accounts, and dumping a canned answer that says "use mysql_function".

Basically, it's a combination of old accumulated "knowledge gunk", and carpet-bombing efforts by "experts" trying to highlight themselves.
Was This Post Helpful? 5
  • +
  • -

#13 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: How do you learn PHP?

Posted 22 February 2012 - 05:34 AM

I did a work term for my college at a web start up where the primary language was PHP. Before then I didn't have much exposure to it but was familiar with other programming languages(Java,C++,C#). The project itself was a mess, spaghetti code, mixing PHP/HTML/CSS/JS all in the same file and even, I shit you not, on the same line at times.

The first couple of months I wrote code that followed the same pattern, figuring that it was the correct way to do things. However I continued to learn from reliable online sources, DIC among them for sure. That combined with a senior developer joining the team who began showing me a better way to do things, templating etc. We ended up refactoring about 90% of the project to be OOP with proper code separation.

When I was just starting out I too was lead astray by the abundance of crap PHP tutorials out there showing bad or deprecated practices. I'm sure this is why about 90% of the newbie posters in the PHP forum still use mysql* functions and procedural style programming.

PHP can be written to be elegant and clean and maintainable but, in the wrong hands, can also be used to create a tangled convoluted mess of a project.
Was This Post Helpful? 0
  • +
  • -

#14 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 - 05:54 AM

I don't understand all these Windows Developers that persist in using the crap that is WAMP/XAMPP etc.

It takes a 2MB download of the Web Platform Installer which will correctly download and install the latest version of PHP, MySQL, Caching, Rewriting, etc. etc. and configure IIS 7.5 for you on your local machine. It's virtually identical to a live WS2k8 environment on your own machine.

Does anybody even use Apache these days, even on *nix? I thought everyone woke up, saw it was shite, and moved on to Lighty/nginx.

EDIT: To be slightly more on-topic rather than contributing to the recently spawned discussion... I've been working on some more web tutorials for absolute beginners that teach them best practices from the start, that is, PDO/MySQLi over the main API, OOP from the beginning to get them well grounded, and using MySQL as an actual relational database by introducing JOINs and the like.

It started off as a project for work where I had a team of web developers (front end) who knew nothing technical but needed to be trained in PHP from the ground up.

This post has been edited by RudiVisser: 22 February 2012 - 05:57 AM

Was This Post Helpful? 1
  • +
  • -

#15 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 22 February 2012 - 09:07 AM

View PostRudiVisser, on 22 February 2012 - 12:54 PM, said:

Does anybody even use Apache these days, even on *nix? I thought everyone woke up, saw it was shite, and moved on to Lighty/nginx.

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.)
Was This Post Helpful? 1
  • +
  • -

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