#native_company# #native_desc#

Learning PHP Using the DIY Method

By Jeffery Vaska
on May 5, 2005

So, you know HTML, you installed an open source CMS application and you need to customize the source code. You need to learn PHP basics and quickly. This is a non-technical, informational article to assist the newbie programmer on their quest for greater programming skills.
First of all, the good news is that it is possible. The bad news is that it could take some time depending upon existing skills and your specific situation. I am willing to bet that many hobbyist programmers (and a few professional ones too) began this way and then proceeded through complexity to greater tasks.
Certainly one could take some classes but this article is geared for those, like most of us, who are used to the do-it-yourself methodology.
How Do I Begin?
Be realistic with what you are about to undertake:
  • Do you really want to learn a programming language or do you just want to edit some scripts?
  • Are you really capable of learning this stuff?
  • Would it be easier to simply pay somebody to do this?
Most people probably answer that they just want to edit some scripts but then find themselves performing more complicated tasks later. Programming is rather addictive once you get started – it’s like Photoshop squared (P to the second power, that is). There are endless possibilities and avenues for exploration. Additionally, you will be joining legions of devotees in the process. It can be a lot of fun too.
A good practice is starting small and working your way up to more complicated tasks. The more you practice the more you’ll realize that smaller and more efficient pieces of code are generally easier to adapt to new situations. Whatever you do, starting with a project like building a CMS is not a very good idea unless you have a huge amount of time.
Proceeding one problem at a time is the best avenue to take until you are ready to start solving larger problem sets.
Read. Read. Read.
Reading is required. There are many great books and online resources available. One that I’m particularly grateful for is the great work by Paul Hudson at Hudzilla.org. It’s a technical explanation of just about anything a newbie will need to know (and more) but written in mostly plain English. When I am asked to help other newbies get started, I send them to Paul’s site. He writes:
“This book assumes no PHP programming skill at all – you will be taught from scratch in that respect. However, I will be using terms like “variable”, “function”, and “loop” freely, so any prior programming experience you have will help enormously.”
PHP.net, aka “the manual”, is absolutely essential reading. However, unless you know what you are searching for it can be a daunting publication. Generally, when used with good advice and other reading materials it becomes an easily accessible resource for quick and precise answers to questions. Similarly, MySQL.com has a fabulous online manual for learning how to connect PHP to your database.
It is amazing how good Google has become. Typically, when I search for PHP information I append my search as “PHP XML MySQL insert” and it always comes through with outstanding results. Never underestimate what Google will find for you in times of need, the Web is filled with a huge amount of tutorials, discussions and information about programming.
Forums Are for Help – not So You Can Look Like an Idiot.
Most forums have rules. They are general enough so that anybody with reasonable common sense can understand them. Read and follow them. Failure to do so could make your journey much more frustrating. This is the link to the PHPBuilder General Guidelines.
More importantly, bring your respect to the table. Receiving free help is a privilege and not a given. If you really want to learn then you should be aware of all the resources a good forum has to offer by looking around first. Often times you will find special threads that answer common questions (FAQ) about programming.
You can not fake the learning process for long – repeatedly fishing for others to solve your problems does get noticed. If you are not engaged in learning you could likely irritate forum members with your laziness. It’s possible that something will be hard to understand at first so you’ll need to learn how to use the materials in addition to the advice of others.
Important note: receiving an answer to your question like “Read the manual – array_reverse” is actually a real answer. It means exactly what it says. One should not take offense to this kind of advice. Everybody, even the professional programmers had to learn via these same methods (perhaps in a more academic setting though), you are no different than everybody else. They are merely trying to steer you through the waters.
Any good forum will have a search feature. Sometimes it can be difficult to search forums as most of their search facilities are either lacking or overwhelmed with too much information, but they can still be very useful. Probably ninety-percent of questions can be answered by searching a forum or using Google before asking it.
As you become more skilled you will ultimately be able to answer your own questions quickly most of the time.
Play Time.
Through all of the previous methods for learning, there will be a wealth of code snippets you can experiment with at your leisure. Set up an environment where you can try them out (either via your own computer or via your Web site). The more you see code in action the easier it is to understand.
Finally, remember that solving small problems is much easier than solving all problems at the same time. Be smart in the forum, do your reading, enjoy the process of learning and the results will be evident. Have a good time, relax and enjoy.