Back to Discover

Technology · Programming

Starting Out with PHP Programming for a Complete Beginner

A gentle, hands-on introduction to PHP for absolute beginners. You'll learn the core concepts of server-side programming by building simple, functional web scripts, from basic syntax and variables to working with forms, databases, and creating your first dynamic web pages. No prior coding experience needed.

540 min9 modulesBeginner friendly
Start this free course

Free to take. This course does not use any Learning Credits.

What you’ll be able to do

By the end of this course, you will be able to write and run basic PHP scripts, handle user input from web forms, connect to a MySQL database, and build a simple dynamic website from scratch.

Course outline

A clear route from first principles to practical confidence

  1. 01

    What is PHP and How Does It Work?

    • What is server-side programming? (PHP vs HTML/CSS)
    • Installing a local server: XAMPP or MAMP
    • Your first PHP script: 'Hello, World!'
    • Understanding PHP tags, comments, and basic syntax
    • Running PHP files in your browser
  2. 02

    Variables, Data Types, and Basic Operations

    • What are variables? Naming rules and conventions
    • Strings, integers, floats, and booleans
    • Concatenating strings and using echo/print
    • Basic arithmetic operators and order of operations
    • Simple debugging: var_dump and print_r
  3. 03

    Making Decisions with Conditionals

    • Understanding true and false in PHP
    • Using if, else, and elseif statements
    • Comparison operators: ==, !=, <, >, <=, >=
    • Logical operators: &&, ||, !
    • Practical example: a simple age-checking script
  4. 04

    Repeating Actions with Loops

    • Why use loops? Counting and iterating
    • The while loop: repeating until a condition is met
    • The for loop: counting with a counter variable
    • The foreach loop: working with arrays
    • Avoiding infinite loops and using break/continue
  5. 05

    Working with Arrays

    • What is an array? Indexed arrays
    • Associative arrays: keys and values
    • Adding, removing, and modifying array elements
    • Looping through arrays with foreach
    • Useful array functions: count, sort, array_push
  6. 06

    Functions: Reusable Code Blocks

    • What is a function? Defining and calling functions
    • Passing arguments and setting default values
    • Returning values from functions
    • Variable scope: local vs global variables
    • Built-in PHP functions you'll use often
  7. 07

    Handling User Input with Forms

    • How HTML forms send data to PHP
    • Using $_GET and $_POST superglobals
    • Validating and sanitising user input
    • Displaying form data back to the user
    • Simple form example: a contact or feedback form
  8. 08

    Introduction to Databases with MySQL

    • What is a database? Tables, rows, and columns
    • Setting up a MySQL database with phpMyAdmin
    • Connecting to MySQL using PHP (mysqli)
    • Running SELECT queries and fetching data
    • Inserting new records from a form
  9. 09

    Putting It All Together: Your First Dynamic Website

    • Planning a simple project (e.g., a guestbook or task list)
    • Creating the database and table structure
    • Building the front-end form and display page
    • Adding basic error handling and security tips
    • Testing, debugging, and celebrating your work