PHP Tutorial

Use of (Website) implies agreement to the following:

Copyright Information

All pages and graphics in this PHP Tutorial is copyright 2013 and are the property of unless otherwise specified.

None of the content on Website may be redistributed or reproduced in any way, shape, or form without written permission from

No Printing or saving of pages or content on Website

This content may not be printed or saved. It is for online use only.

Linking to Website

You may link to any of the pages on Website; however, you may not include the content in a frame or iframe without written permission from


Website is provided without warranty of any kind. There are no guarantees that use of the site will not be subject to interruptions. All direct or indirect risk related to use of the site is borne entirely by the user. All code and explanations provided on this site are provided without warranties to correctness, performance, fitness, merchantability, and/or any other warranty (whether expressed or implied).

For individual private use only

You agree not to use this online manual to deliver or receive training. If you are delivering or attending a class that is making use of this online manual, you are in violation of our terms of service. Please report any abuse to [email protected].

Table of Contents

PHP Basics
  1. How PHP Works
  2. The php.ini File
  3. Basic PHP Syntax
  4. Variables
  5. PHP Operators
  6. Creating Dynamic Pages
  7. Extra: Variable Scope and Superglobals
Flow Control
  1. Conditional Processing
  2. Loops
  1. Indexed Arrays
  2. Associative Arrays
  3. Two-dimensional Arrays
  4. Array Manipulation Functions
PHP and HTML Forms
  1. HTML Forms
String Manipulation
  1. Formatting Strings
  2. Magic Quotes
Reusing Code and Writing Functions
  1. Including Files
  2. User Functions
  3. Form Processing
Managing Data
  1. Querying a Database
  1. Using a Database Abstraction Layer
  2. Using MDB2
Authentication with PHP and SQL
  1. A Database-less Login Form
Regular Expressions
  1. What is a Regular Expression
  2. Form Validation Functions with Regular Expressions
  3. Perl-compatible Regular Expression Functions
Session Control and Cookies
  1. Sessions
  2. Cookies
Sending Email with PHP
  1. mail()
  2. PHPMailer
File System Management
  1. Opening a File
  2. Reading from a File
  3. Writing to a File
  4. File Locking
  5. Uploading Files via an HTML Form
  6. Getting File Information
  7. More File Functions
  8. Directory Functions

This page was last updated on 2022-05-20

All pages and graphics in this PHP Tutorial is copyright 2013 and are the property of unless otherwise specified. The purpose of this website is to help you learn PHP on your own and use of the website implies your agreement to our Terms of Service.