Skip to main content

Posts

$_get in php examples

$_get in php examples By using this super global variable we can het the posted values of get method. <form method="GET" > username:<input type="text" name="username"></br> password: <input type ="password" name="password"></br> <input type="submit" name="submit" value="submit"> </form> <?php echo $_GET['username']; ?>

Super global variable in php

  Super global variable in php Super global variable are special type of variable in php.   We can access them from any place With in the application. All S.G.V   are array data types the available types are $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE, $_SESSION, $_FILE, $_ENV.

Static variable in php examples

Static variable in php examples  Static variable can maintain the previous value we can assign the value only one time to the static variable. Reference variable in php examples This reference variable symbol is & <?php $x=100; $y=&$x; Echo $y;//out put 100 $y=200; Echo $x;// out put 200 ?> 

Global variable in php examples

Global variable in php examples A variable declaration out side the function is called as global variable. We can’t access the global variable directly from the function. To access the global variable we can use $GLOBAL key word call the global variable. We can also call the global variable from function by re declaring   the variable with GLOBAL  key word with in the function.

Local variable in php examples

Local variable in php examples Variable declaration with in the function is called local variable. The access able scope of local variable is that function only <?php Function fun1() { $x=100;// variable declaration with in the function Echo $x; } Fun()1;//function  call ?>