Web Wide Way

Web World News

PHP Lessons (2)

variables – $

<?php
$hello='Hello,';

echo "<br>";
$num1=’7′;
$num2=3;
$result=$num1+$num2;
// one line comment
echo "this class is" .$result;
/* multiple
* lines comments
*/
echo "<br>";
$a=3;
$a++; //$a=$a+1
echo $a;
echo "<br>";
++$a;
echo $a;
echo "<br>";
$b=4;
$a+=$b;
echo $a;
echo "<br>";
$hello.=’world’;
echo $hello;
//@include ‘mytest.php’;
//@require ‘mytest.php’;
//echo "after error text";
//$str=`dir c: `;
//echo "<br> <pre>" .$str. "</pre>";
echo "<br>";
$age=44;
if ($age>;120)
{
echo "RIP";
}
else {
echo "long live";
}
?>;

global variables
$_GET, $_POST, $_COOKIES

Category: php lessons