PHP Variables
Syntax
In PHP, variables are declared using the $ symbol followed by the variable name and can store different types of data.
// Declaring variables$name = "John"; // String$age = 30; // Integer$isAdmin = true; // Boolean$height = 5.9; // Float
// Accessing variablesecho $name;Example
<?php// Assigning values to variables$name = "Alice";$age = 25;
// Using variablesecho "Name: " . $name . "\n"; // Outputs: Name: Aliceecho "Age: " . $age . "\n"; // Outputs: Age: 25?>