Well if you're just starting, trial and error is a great way to learn. When you're not sure of something, try it out! I did the same thing when I started. As you get deeper into PHP you'll do less trial and error.
One suggestion I do have is find ways to use loops. They saved me a TON of time once I discovered how to properly use loops such as while, for, and foreach.
Browse the forums and read people's questions/answers to learn how others would go about solving that problem. In PHP, there are many different ways of doing the same thing. Read people's responses to see how they would do it. You'll learn a lot and pick up on other people's techniques.
Good luck.
Cgraz