Just practice, practice and practice. Look at example scripts/code you've got and modify them is the easiest way to learn I find. eg, a basic hello world code
PHP Code:
<?php
echo 'Hello World';
?>
can be changed to say the time, date, then add a counter to say how many times the page has been viewed, and slowly work your way up. You'll eventually pick it up and be able to find functions you need to use by google or php.net