How long did it take you to learn PHP?
amnion - June 2, 2008 - 16:16
I am hoping to get a general idea of how long it took some of you to start getting good at PHP/mysql. Obviously, this topic pertains to Drupal, and I'm hoping that one day I can make some kind of a valuable contribution in that regard. But aside from my first question, here are some others:
What advice do you have for new people wanting to learn PHP?
What resources can we use to help us along the way?
Do you think learning on your own is as effective as taking instruction?
Also, how long do some of the modules take to develop from scratch?
I want to get the whole picture here! And thanks in advance to anyone who participates in this discussion.

There is really no fixed
There is really no fixed answer to your question because the answers depends in part on your background and what you to do.
Regarding PHP learning it was fast for me but I had already programmed in similarly structured languages for some time and it was mostly getting familiar with the PHP libraries. If you already have some programming experience yourself the PHP website is a good reference resource. As for how to learn that very much depends on your own style and background.
As for how long it takes to write a module, you first need to understand the appropriate Drupal APIs on top of understanding PHP. So personally I have written modules in less than an hour (a very simply module) and I have spent over 40 hours on one module (more complicated). So time will very with your understanding of PHP, the Drupal API's and the problem at hand.
I hear that, I guess it
I hear that, I guess it depends on one's level of experience and motivation. Do you know of any good resources besides php.net? I stumbled upon www.sitepoint.com earlier today and it seems like a great place to hang out. Does anyone else go there?
PHP for Dummies
I just ordered this from Amazon to read while I'm not entranced by the online course I'm also taking, which seems to help out a lot better than just reading a book. I've tried to read PHP books before and it definitely helps to have interactive examples. If anyone's interested, there is a beginning PHP course over at www.remotecourse.com (along with a lot of other courses) for only $99. I have a year to take the lessons as often as I want to.
I've also heard that you should just dive in and start practicing as much as you can, like try to come up with your own hacks for stuff. Do you guys have any further advice?
took me not more than a week
took me not more than a week since I had worked with c and ++ earlier. The syntax is similar to some extent and besides once you know a language already it is really easy to learn another. Besides php is user friendly and does most of the things for you :)
Ali Hammad Raza
WordsValley
Do you have a programming
Do you have a programming background?
I'm assuming maybe no because you're asking. In that case you need some kind of intro to programming book. Whether you're learning c, c++, java, visual basic, python, or php it's all pretty much the same core concepts: variables, flow control, looping, and procedures. Once you learn how to program the language doesn't much matter (excusing some languages such as lisp or SQL etc.), but it's critical that you understand those concepts. Beyond that is learning about object oriented programming which is the major programming paradigm of today (although drupal doesn't use it directly but in an indirect way)
A decent resource for core concepts is:
"How To Think Like A Computer Scientist" available free at:
http://www.openbookproject.net/thinkcs/cpp/english/
Unfortunately there isn't a php version, it's c++ (there's also a java and python version), but php has c-style syntax and the core concepts are the same. Intro programming courses in university are taught in c, pascal, basic, python, java, etc. and you don't get to pick and it doesn't really matter which one because again the core concepts are the same. That said, you should probably be able to go to your local library or Amazon and get a php intro book.
Also, don't forget about youtube. Video learning is great way to get up to speed quickly. Just search for php or php tutorial.
No programming background
I've done a lot with html and css (by that I mean I can figure out any problem I'm having by doing good research and I have a solid grasp of the basics). I'll definitely check out that book on thinking like a computer scientist. I read in a few other forums on other sites that it usually takes a little bit to grasp it when you're new but you'll all of a sudden be able to wrap your head around it and it'll make sense and be easier for you to work with. I'm just getting started and I am starting to make more sense of everything, but just last night I tried looking at a module somebody had made, you know, to see what all I could really understand and I was pretty intimidated by what I saw. PHP is very daunting, but I'm going to keep chugging along and not try to burn myself out.
Do you guys think it's better to learn at a steady rate or just completely immerse yourself in it? What are some of the ways you have learned PHP, mysql, etc? Also, can someone explain what Ruby on Rails is?
It's good that you already
It's good that you already know html. Don't be intimidated by not understanding somebody else's code - it adds a whole new layer of complexity when you don't understand the context of the code. You not only have to figure out what the code is doing, but also what the variables mean and what you think the programmer was trying to do. My personal favorite learning site is http://www.w3schools.com/default.asp (PHP is on the left sidebar under "Server Scripting"). It might not go into enough depth for a beginner, though. If I were you, I would find a good tutorial and try to stick with it. Try copying and pasting and running the snippets of code in the tutorial. Try modifying this code and see what happens. Play around with the code until you feel like you have a reasonably good understanding of it, then move on to the next tutorial page. I would agree that at first it can be hard to wrap your head around, but once you start to figure out how to think you have a very powerful tool that you can apply to a lot of other computer tasks. Best of luck to you!
I think I took a course in
I think I took a course in C++ in high school and forgot all of it shortly after taking the final.
I've played around with drupal for about a year, but never had the need to do much more than theme for the sites I've used it for (just changing templates and css). I started looking at the code behind it not too long ago... at first I would see what's going on, I'd have a clue of what needs to change to do what I need, but I'd struggle with getting the syntax right.... or have no clue of what variables/functions/etc are available and spend hours looking for them. Although, I must say, I am getting better with practice but not quite up to writing anything major....
I think all people are different learners. Some learn best from instruction. Some learn best from trial and error And some learn best from a combination of both.... I don't do well with any kind of teaching, so teaching myself from example and googling the parts I can't understand seems to work for me (for some reason the php book laying on my desk simply intimidates me).
Best of luck.
*SomeGirl*
currently working on my blog....
also learning, but only get blank pages
I'm also attempting to learn PHP with an html, css, and javascript background. I'm having a heck of a time, however, because I can never get my php pages to display anything but a blank white screen. I go through tutorials, write out the sample scripts, and then try to open them in a browser and only get a blank white page back. For example,
Hello World!
<?php//Write out Hello World!
echo 'Hello World!';
?>
returns a blank page but with the right title, Hello World. So it's picking up the HTML, but not the PHP. Firefox doesn't return any errors in the error console on page load.
I have a Drupal localhost set up and running on my machine and I think my problem comes from not knowing where to save the php files that I'm trying to create and learn with. My local host is in D:\www, and the folders I have available to me in that directory are analog, Apache22, cig-bin, drupal_files, fcgi-bin, mysql5, openssl, perl, php5, phpmyadmin, private, tmp, WDC, webroot.
I know I am missing something obvious and it's frustrating.
Hello
So it only puts the title and nothing else? Have you tested any other scripts out?
other scripts
I've mostly been playing with echo and print--both just display a blank page.