PHP Lessons (2)

January 20, 2010

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

Entry Filed under: php lessons. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Blogroll

Archives