PHP Syntax & Variables
Learn the fundamental syntax of PHP including variables, data types, and basic operations.
Variables
PHP variables start with the $ symbol:
<?php
$name = "John";
$age = 25;
$price = 19.99;
$isActive = true;
?>Data Types
- String
- Integer
- Float
- Boolean
- Array
- Object
- NULL
String Concatenation
<?php
$firstName = "John";
$lastName = "Doe";
$fullName = $firstName . " " . $lastName;
echo $fullName; // Output: John Doe
?>