How long did it take you to learn php?

This is a very nice question. We can divide it into many sections such as how long it took to master a basic php function like e-mail, how to check for errors in e-mail, writing to scripts, doing a database driven web site, contact management or pdf in php.

Despite the fact that I understood cgi very well, It took me about one year and the real issue is getting the right books.

I’m still learning :slight_smile: It’s taken me a few months to grasp the basic principles.

I’m with Nathan on this one. Start at the deep end, and try to develop a full large scale project, such as an entire site or a forum. Ask for help on forums when you get stuck, refer to tutorials similar to the component you’re working on and gradually you’ll build up a full application. It took me about 4 months for my first PHP driven website.

Now that I’ve made something on a large scale, I feel I can make smaller applications quickly and more easily.

if you’ve only done very basic very basic coding before(editing forum code for mods),is php good to start off on or should use something simpilar like html first?

You should learn something harder first. Learning C before PHP will make PHP very easy (as in, snap-of-the-fingers-easy) to learn, and C very hard. Learning PHP before C will make PHP standardly difficult, and C incredibly difficult to learn. It really isn’t easy to go from type-less/loose language (PHP) to a data-typed/strict language (C), but it’s very easy to go the other way.

ok thanks I think I’ll start on that first.could you recommend anywhere i could learn it or the basics of it?

I started learning PHP about 2 years ago. I am still learning it and always will be. PHP is a huge language and always will be. Its only going to get more complex.

I started in 2001 (my junior year in HS), initially tinkering around with the forum software vBulletin. Originally setup myself a free hosted site w/a friend and slowly built “hacks” (code modifications) for vBulletin. 7 months later I became confident enough in my hacks that I was releasing them at the vBulletin community site, vBulletin.org. An advantage to that is the competitive atmosphere amongst coders at vBulletin.org, i.e. who can think of the most innovative hacks and gain most popularity from them (“installs”). As quite competitive individual that I am (mostly as an athlete during those years), it motivated me much more to learn PHP and MySQL–even spent about 8-10 hours a day at it during summer 2003 (whilst conditioning for Fall cross country season). I basically severed all my past video/computer gaming habits because I was addicted to web development. :smiley:

My advice is to maintain high motivation, set your goals and stay on focus. Competition does help, if you can find a community to code with. I still suggest for beginners to hop onboard the forum software modification community (phpBB, vBulletin, etc.) and learn from tinkering with the software.

PHP took me about a half year to grasp the language… this is coming from only HTML/CSS experience. I’d say it was a full two years before I could build a full forum by scratch using OOP and having it be relatively feature-filled.

You will never stop learning, until the day you die.

Think about doing something useful with PHP. Then do it.

I agree with Nathan on learning a more difficult language first. I started with C, C++, and Java. After understanding the basics concepts of any programming language, php becomes very easy, and you’ll begin to appreciate some of the ways php lets you cheat. Because php is such a loose language, you can build a site or application with really sloppy code.

If learning to program is your goal, start with a stricter language. If building a site with some functionality is your goal, starting php is okay.

The reference manual at php.net is a wonderful resource for learning functions that will help you build your site. Read the user comments. Lots of times I’ve been trying to do something, and a user has posted some code that does exactly what I’m looking for.

Like everyone else, I’m still learning. There is always more to learn.

rep++ on nathan’s first post in this thread.

I disagree about learning a harder language first though. I think it all depends on the individual. I’ve recently heard someone describe PHP as a “gateway drug” to other languages. A language as simple as PHP can be a good way to learn the fundamental principles of web programming(and programming in general). In that way it can be a stepping stone to more difficult languages.

Also, if after the first 6-12 months, you don’t realize that everything you’ve done so far is utter crap, then you’re not making any progress.

Here’s a chronological rundown of how things might go:

Months 1-6: Become able to build useful web applications.
Months 6-12 : Realize that your code is inefficient, unmaintable and insecure.
Months 12-24 : Spend time learning OOP and some basic design patterns.
Months 24-30 : Entirely spent in a 3-way argument between you, McGruff and DrLivingston in the advanced PHP
forum over whether a particular 10 lines of code belong in the view layer or model layer.
Months 30-36 : You realize almost everyone doing PHP sucks, but that you still suck compared to most
Java and C++ programmers.
Months 36-42 : You realize that PHP would be much better if it were identical to Java(or Ruby).
Month 43 : You realize you haven’t been laid for over 3 and a half years.

If you are experienced in:

  1. Programming
  2. HTML coding
  3. SQL

You can start developing your fully functional website in less than an hour of reading. With the amount of resources available online about PHP, you can find a solution to a problem you will possibly face by googling. Of course, you will walk slowly and might miss a lot of important points, especially regarding security and performance, but this happens to be the best way of mastering PHP.

Of course, if you are missing any of the three skills I metioned above, you will need the time to learn them first.

PHP was my first scripting language that I picked up. Javascript scared me in the past for some reason. I picked up Kevin Yank’s book and it really got my feet wet. I’d say it took me about a month of writing some basic code and editing the samples in the book before the bulb started flashing in my head about the way things were supposed to work.

In the beggining, i remember having a hard time debugging the code becuase i’d make careless nubie errors here and there. Luckily I have a good editor with syntax highlighting and bracket matching which really helped me with parsing errors. After enough mistakes, i knew exactly what the error codes were and where to spot them when i made them. Things got easier and easier from there.

Like everyone else said before, you’ll constantly be learning throughout the process. Even when you think you’ve got it down, you’ll find a code snippet soemwhere that does something that you didnt think was possible and vu la, you learned something new.

I started out with an idea for a site that I always wanted to create. I knew it was going to be a major under taking. 1.5 years later i’m still working on the same project. Its amazing how when i look back at the code i was writing in the begging, how horrible it was. It wasnt efficient or very well structured, but i’ve to keep adding to it over the past year revising the really bad parts.

This project alone has taught me alot. I’m almost nearing the “end” where I can say I have a great product that is 95% stable (i cant account for the other 5% because its probably things I cant think of until something breaks and I realize my errors). As with anything, a project is never really finished, you can always tweak things, add more functions, make it more efficient. I can see my current project still being in the works for another year as i think of more and more features I can add. Its been a labor of loves.

I’ve made hardly squat off of it (soon to change once i finish it and feel comfortable with my product and can actually start selling it, its in quasi beta stage), but the feedback i’ve recieved has been a good motivating factor when i’ve been spent.

To make the long story short. PHP took me about a month to write some basic stuff, about 3-4 months to have a really good handle and about the rest of the time to learning new techniques and using functions more efficiently. I bought the sitepoint OOP PHP, but havent had the time to sit down and get into it. But thats my next stage that will take me to the next level.

What i most enjoy about learning a functional langue is that it creates opportunites. It gives you a means to bring an idea you have to life. The creation of something “tangible” from nothing is really cool in my opinon.

Anyhow, good luck. Stick with it, you may end up creating the next ‘big thing’.

I’ve been into PHP for a while now (don’t know an exact date). I spent quite some time on very very basic builtin functions, and with my past experience with programming, I became pessimistic, so I didn’t consider learning more. Well, the need finally arose to learn more, so I did, it was actually quite easy. I went from telling people what time it is on my server, within an invalid HTML 4.0 page. To Valid XHTML 1.0 Strict, and a database driven website with multiple users and categories.

It was quite a shocking leap, but I tackled it, and spent all my time learning PHP. I feel sorry for my girlfriend for having to deal with me through that time, but the outcome will be positive I’m sure.

It really shouldn’t take a computer literate person long to get a grasp on PHP, I’ve been on a computer since I was four, I’m now 16. I spent a lot of time repairing computers, and stuff like that, for a familly owned computer store. Wrote my first website when I was eight or nine (not bragging, it was geocities, and I would deny its existance if someone found a screenshot of it). Then I got into PHP about 5 years later. Now I’m here.

Sorry for rambling, I do that quite a bit =\.

~Jabird

Could not have said it better. If you’re going to be creating a site with a DB backend. The achilies heel of your site is your DB. It needs to be organized effectively to retrive your pertinent data. Remember to break your data into logical parts and put them into different tables.

Learning SQL is another effort in itself, but VERY useful. I’ve come here countless times looking for help on my queries. user r937 has been a tremendous help to me over the past year. the man is a demi-god when it comes to sql.

Months 1-6: Become able to build useful web applications.
Months 6-12 : Realize that your code is inefficient, unmaintable and insecure.
Months 12-24 : Spend time learning OOP and some basic design patterns.
Months 24-30 : Entirely spent in a 3-way argument between you, McGruff and DrLivingston in the advanced PHP
forum over whether a particular 10 lines of code belong in the view layer or model layer.
Months 30-36 : You realize almost everyone doing PHP sucks, but that you still suck compared to most
Java and C++ programmers.
Months 36-42 : You realize that PHP would be much better if it were identical to Java(or Ruby).
Month 43 : You realize you haven’t been laid for over 3 and a half years.

LoL

Thats gotta be one of the funniest posts i’ve read in a long time. Sadly enough, i think i’m right on track. Except i think i was a bit ahead of schedule in learning that my code is inefficient, unmaintable and insecure… Although its better now, I still havent been able to design in patterns or do anythign complex… I hope it happens next year, because right now it doesnt make much sense at all.

These two points were the points about which I’ve always been thinking and been afraid (afraid, that some day I’m gona realize that I suck compared to Java and C++ programmers).
I mean is a Professional PHP programmer considered a real serious professional web-developer?

I’m still afraid that what I’m doing is something unprofessional (I’m about in your described 3rd point period, learn OOP principles make my code as clean and as reusable as possible, learn dependecny injection, design patterns, database abstraction etc…) and still I think that this is not enough I’m still an unprofessional and maybe I will never be!

So am I right or wrong?

P.S. Every time I learn something I realize that much more has to be learned, I want to say that I’m always willing to learn and I’m not standing on one place and waiting…

The problem is that PHP has a low entry level. Therefore, you will suffer the same problems a professional Visual Basic programmer used to have…

Imho, if you want to become a proficient programmer you shouldn’t think in function of the language but in function of the problem. And then choose the most appropriate language. (More general: the right tool for the right job)

The problem for a complete newcomer is that he needs to learn also HTML, SQL and algorithms/data structures too. And all these subjects might take a while to master…

I guess you’re right and I think that I’m thinking in function of the problem, maybe later I will realize that it’s the time to turn to another language and I will do so.

It’s just when I say to my friends, teachers that I’m a PHP programmer they use to laugh at me and make me think that what I do is not serious and unprofessional…anyway…time will show… :slight_smile: