Forum Moderators: coopster
Let's not recommend any of my code :) I got started with PHP by reading a book first. I spent 3 or 4 days digesting PHP 4 Bible (Converse & Park). After that it was just a matter of getting my feet wet.
The problem with looking at code is this: You are not only dealing with trying to understand the code itself, but the logic applied by the coder. Any one of us in this forum might approach the same problem with differing views about how to solve the problem. IMO, that's not an easy way to learn the basics.
this thread might help
Learning PHP - Books, Tutorials and Online Resources [webmasterworld.com]
there are a bunch of other tutorial type posts in the PHP Library [webmasterworld.com] as well
Anyway back to the point, just as you wouldn't learn how to paint by looking at those paintings you won't learn how to code by looking at someone elses code. You can admire the paintings and get ideas to use in your own work like color, brush strokes prespective. And you can do the same looking at someone elses code ("Oh wow, look how he did that for( ) statement. He saved 15 lines of code that way.")
As for getting started you realy need a teacher or a book(or both if you can swing it)
First you need to learn programing basics. logic and design what are functions, variables, scope, opperators expressions etc. (You may allready know this if you know other languages)I'm pretty sure most programing books cover this in the first chapter some probably better then others. After you have this down it makes the syntax of other languages easier to pick up... at least until you start puting statments like "int i=0;" in your php code.
Then start in with actual php. I suggest a book by Kevin Yank from sitepoint books. I have the O'Reilly programing php book which helps as a desk refference but it isn't great and I wouldn't buy it again... but I got it at 50% so..
I hope this helps .. I am kinda long winded.
Sarah
We should do challanges for simple scripting ideas and see just how many different ways people can attack the same problem. maybe even have special awards for shortest and longest code.
Another great way to learn is to read other people`s code. If you have a project you want to tackle, download some open source scripts and read the code to try and make sense of the logic. You can read it over and over in black and white, but sometimes an example of what you are trying to accomplish can make all the pieces fit into place.
The great thing about PHP is you`ll see things happening pretty much from the off and once you do, it will get to be a kind of addiction. Not a good thing if less computer time if what you are after. :)
If you have any problems, post here and we will try and help you out.
Good luck!
dc