PHP Part1
PHP Part1
HTML (Intro)
HTML (Lists)
HTML (Tables, Links)
HTML (Images and Image Map, Frames)
HTML (Cascading Style Sheets)
JavaScript (Basic Operation)
JavaScript (System Event)
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
<?php
//This is a comment
/*
This is
a comment
block
*/
?>
</body>
</html>
<html><body>
<?php
$x=5;
$y=6;
$z=$x+$y;
echo “$z”;
?>
</body></html>
Result is: 11
<html><body>
<?php Test variables inside the
$x=5; // global scope
function:
function myTest(){
$y=10; // local scope Error on Server
echo "<p>Test variables inside the
function:</p>"; Variable y is: 10
echo "Variable x is: $x";
echo "<br>";
echo "Variable y is: $y";
}
myTest();
?>
</body></html>
<html><body>
<?php Test variables inside the
$x=5; // global scope
function:
function myTest(){
$y=10; // local scope Variable x is: 5
global $x;
echo "<p>Test variables inside the Variable y is: 10
function:<p>";
echo "Variable x is: $x";
echo "<br>";
echo "Variable y is: $y";
}
myTest();
?>
</body></html>
<html><body>
<?php 0
function myTest() {
static $x=0;
1
echo $x;
$x++; 2
}
myTest();
echo "<br>";
3
myTest();
echo "<br>"; 4
myTest();
echo "<br>";
myTest();
echo "<br>";
myTest();
?> </body></html>