Sunday 24 February 2013

PHP:Variables

Lectures#3

Hi!guys today i want to talk about the Variables of the PHP......................................

so here we go..........................................................................

PHP variables like a constraints use for sorting information....

see example below..................................................................................

<?php

$a=10;
$b=5;
$c=$a+$b;
echo $c;

?>

echo is used for print purpose...................

It is related to................algebra
 like a=10;
        b=5;
       c=a+b;
c=15 Result


  •  A variable start with the sign $ followed by the variable like  $a
  •  A variable name must start with letter or the underscore character
  • Variable contain alpha numeric character and underscore character
  • A variable name does not contain space
  • Variable names are case sensitive ($a and $A)
 Declaring PHP variable

It is not a command for declaring variable...
  variable is created as

$s="text-here";
 $a=5;

Above the two variable is  declare

 when $s is executed then text-here value is print
and when $a is executed then  value is 5..........

PHP Variables Scopes
  • Local
  • Global
  • Static
  • Parameter


  To be continued ......................................


For learning PHP and other Programing languages ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,subscribe my bloger feed..
                 

                                    Thanks





0 comments:

Post a Comment