Syntax & Variables

Learn how to write your first PHP script and store data in variables.

Control Structures

Master if/else statements, switch cases, and conditional logic in PHP.

Arrays & Loops

Work with arrays and iterate through data using loops in PHP.

Functions

Create reusable code blocks with PHP functions and understand scope.

Coming Soon

Content for Control Structures will be available soon.

frame-238.png

  •  
    Understand PHP tags <?php ?>
  •  
    Datatypes: String, Integer, Array
  •  
    Declare and use variables

Implementation Guide

Learn how to write your first PHP script and store data in variables.

arrow-big-right.png

Step 1: Create a PHP file

Create 'index.php' in 'C:/laragon/www/team-php/'

arrow-big-right.png

Step 2: Write code

<?php
    $greeting = "Hello, Laragon!";
    $year = 2025;
    echo $greeting . " Welcome to " . $year;
    ?>
arrow-big-right.png

Step 3: Run it

Open browser: http://learn-php.test

bug.png

Common Issues

Learn how to write your first PHP script and store data in variables.

info.png

White screen / 500 Error

Check for missing semicolons (;) at end of lines.

info.png

Variables not showing

Ensure you use the $ sign before variable names.