#5. PHP Variables

 What are Variables?

For Example more than one  print Aqib

echo "Aqib";

echo "Aqib";

echo "Aqib";

Or

$a = "Aqib";

echo $a; 

echo $a; 

echo $a; 

 Integer Numbers :

$num = 232.22;

echo $num; 

 How to write a Variables Name:

Right way:

  • $firstname
  • $_firstname
  • $first_name
  • $first-name
  • $firstName
  • $firstname22

Wrong-Way :

  • $first name
  • $99firstname

  • $first#name

Not same
  • $age  or  $AGE
Run Code :
<?php
    $name = "Aqib Saeed";
    $num = 1232;
  //  echo "<h1>" .  $name . </h1>;
    echo "Hello " . $name;
   // echo $name;
   // echo $name;

    echo $num; 

?>
O/P
Aqib Saeed

Aqib Saeed

Aqib Saeed

Aqib Saeed 

Comments

Popular posts from this blog

#30. PHP Recursive Function