Services Work Learn About Contact
0/8
Lesson 2 of 8

Variables & Data Types

PHP variables start with a dollar sign $. They are loosely typed — you do not declare the type. Common types: string, integer, float, boolean, array, null.

PHP
<?php
$name = "Ali";       // string
$age = 25;           // integer
$price = 19.99;      // float
$isActive = true;    // boolean
$items = ["a", "b"]; // array
?>
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed PHP!

You finished all 8 lessons and quizzes. You now know the basics of PHP.