Visit complete PHP roadmap
PHP Topic

PHP Syntax & Variables

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
?>

More Topics

Explore related content

View All Topics
Loved by 100K+ Developers

Start Your Learning
Journey Today

Join thousands of developers who are leveling up their skills with structured roadmaps and expert guidance

No credit card required
Always free
Track your progress