one way of learning is: try and error and you might learn it
the other way: read .. read .. read till you know all the theories
i think a combination of those two is far the best. So you might want to check you your local computer book seller.. there are some really nice books on the market about php..