Beginners PHP tutorial

PHP is probably easier to learn than JavaScript because it runs on the server. That means it doesn't need to worry about different browser versions so the code should work for any page. The purpose for PHP is to allow pages to be customised by the server for different people, times or purposes.

For now you will not access databases which is a bit of a restriction because PHP and MySQL are a great partnership but that will come soon so be patient!

These pages assume you know the basics of HTML and CSS so if you do not you should go to those tutorials first. You need to be especially aware of HTML forms.

Hover over the links for a brief description.

  1. How PHP and HTML mix
  2. PHP and quotation marks
  3. PHP variables
  4. PHP arithmetic
  5. PHP if
  6. PHP if else
  7. PHP if elseif
  8. PHP arrays
  9. PHP for loops
  10. PHP foreach loops
  11. Splitting and joining PHP variables and strings
  12. PHP super globals
  13. Searching strings in PHP
  14. PHP forms
  15. PHP forms on a single page
  16. PHP and file handling
  17. PHP and file handling - file structure
  18. Uploading a file with PHP
  19. PHP while statements
  20. Using $_GET to pass data between PHP pages
  21. PHP and graphics
  22. PHP functions
  23. Some other thoughts on PHP
submit to reddit Delicious Tweet