For PHP Beginners
When I was first learning how to use PHP, I was looking for all the knowledge I could get. I bought book, read tutorials online, what ever I could find, people to talk to. I quickly realized that no two people had the same approach to teaching beginners and, they often made reference to not providing information that they thought to be useful but possibly confusing.
WHAT! Are you kidding me? So while the author spouts off about how this function operates just like it’s C counter part (which I know nothing about), they won’t provide me with knowledge that may be useful to the language I’m actually learning?
So if you’re just starting to learning PHP keep these helpful tips in mind.
- Always assume there’s a smarter way to do something in PHP than how it’s presented to you.
- If you start commenting your PHP code now you’ll continue to do it in the future. Commenting your PHP code now will help you and those who may have to maintain your PHP code after you’ve moved on.
- Indexed and associative arrays can be looped using PHP which can save you a lot of time.
- Don’t be afraid to use as many PHP files as you need to keep your code separated and clean.
- Use a PHP configuration file to store common information that will affect the entire site. This way you can make a change in one location and the site will be updated. (Hint: MySQL connection information)
What I’m not providing you with in this post are lengthy examples of each of the topics I’ve listed above. Whereas I don’t think the information will confuse you, more so that each bullet point is a lengthy topic with in itself. I’ll cover these topics in later posts.

October 19th, 2008 at 1:59 pm
Thanks for your input for beginners like myself, I did purchase a PHP book for beginners but what it contained was examples for creating your own basic scripts, however I wanted something different since there are so many resources already online for scripts that you can build upon. I guess I’ll have to scour through some more books til I find something that matches the way I’d like to learn PHP. For now I just dabble in it.