Variables in PHP

<?php
$name = "Saim";
$age = 25;

echo "My name is $name and I am $age years old.";
?>

Explanation:

  • Variables in PHP start with $.
  • Strings inside double quotes can include variables.
  • Output: My name is Saim and I am 25 years old.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *