Friday 22 April 2011

Comments in PHP Code



Comments in PHP Code

Comments are used to stop the execution of a line or set of lines script.
“//,#” are comes under single line comments.
“/*,*/” are comes under multiple lines comments.
Ex:
<?php
echo "Hello World!"; // This will print out Hello World!
echo "<br />Psst...You can't see my PHP comments!"; // echo "nothing";
// echo "My name is Humperdinkle!";
# echo "I don't do anything either";
?>
Isset: This function is used to check the variable is set with any value or not.
Ex:
<?php
$x=100;
$sno;
echo isset($x);
echo isset($no);
?>
Unset: This function unsets a variable value.
Ex:
<?php
$x=100;
unset($x);
?>


Ini_get: By using this function we can get the configuration directive values. And Also we can change the configuration directive values.
<?php
echo ini_get("precision");
ini_set("precision",16);
echo ini_get("precision");
?>
Note: In php dot(.) is an operator used to concatenate two values.
Ex:
<?php
$x=100;
$y=200;
echo $x.$y;
?>

Note: In PHP “@” is an operator used to hide the errors.
Ex:
<?php
@fun1();
echo "next";
?>

0 comments:

Post a Comment