Powered by Blogger.
Showing posts with label How to Create a Variable in Php. Show all posts
Showing posts with label How to Create a Variable in Php. Show all posts

How to Create a Variable in Php and Print

Monday, 14 July 2014

How to Create a Variable in Php :-


You have Create a Variable in Php Using the "$" Sign.

Rules of Variables is Following Listout.

  1. Variable Name Must be Start with a letter (a,b,c........) or underscore (_).
  2. Variable Name Length is Maximum 32 Character.
  3. Variable Name is the Case Sensitive.
  4. Variable Name into Contain the Alpha-Numeric Character and Underscore.

Syntax of Create Variable :-

        $Variable_name=Value;

Example 1 :-


<?php
      $a=3;
      echo $a;
?>

Example 2 :-


<?php
      $a=3;
      $b=5
      echo $a+$b;
?>