Variables and Data Types in PHP
Understand variables, strings, numbers, booleans, and how PHP handles types.
Sophia Miller
December 21, 2025
0.0k0
Variables store data. In PHP, they always start with a $ sign. ## Creating variables ```php <?php $name = "John"; $age = 25; $isStudent = true; ?> ``` ## Common data types - string: "Hello" - integer: 10 - float: 3.14 - boolean: true / false - array: list of values - null: no value ## Using variables ```php <?php echo "My name is $name and I am $age years old."; ?> ``` PHP replaces variables inside double quotes. ## Type checking ```php var_dump($age); ``` Shows type and value. > Next: Operators and basic math in PHP.
#PHP#Variables#Beginner