variables in php

If you have learned C,C++ you know about variables.Also in PHP ,variables are used.Variables in php used to store information and also to get back information when we need.

php variables

Points to Remember while using PHP Variables

  • Add $ before  variable name like this $variable
  • Variables are case-sensitive.Example:There is difference between $variable & $Variable
  • Variable should not start with numbers like $123.
  • Variable should not start with * like $* variable.

Use wamp server to learn php If you have not yet used see  the below link,

Learn php in wamp server

  • Open notepad copy and paste the below code in notepad

    <title>PHP sript</title>

  • You get output like,


  • Save in php format.Goto wamp folder>>www and place the php file.Open wamp server
  • We have used <br>  to display name2 in next line.
  • If you want to connect two variables add .$variablename like below

    <?php echo"$variable".$Variable;?>

  • You get output like,


There are more things in php variables we will share in further posts.

Print Friendly and PDF

About me

Hi. I am interested in blogging.And sometimes play with webdesign,web development,domain sale,designing logo and more.

    Blogger Comment
    Facebook Comment


Post a Comment