2. Install Webserver
Linux
http://www.apachefriends.org/en/xampp-linux.html
3. An introductory example
<!DOCTYPE HTML PUBLIC "-//W3C//
DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
8. PHP Variables
<?php
$var = 'Bob';
$Var = 'Joe';
echo "$var, $Var"; // outputs "Bob, Joe"
// invalid; starts with a number
$4site ='not yet';
?>
9. Reference Variable
<?php
// Assign the value 'Bob' to $foo
$foo = 'Bob';
// Reference $foo via $bar.
$bar = &$foo;
// Alter $bar...
$bar = "My name is $bar";
echo $bar;
// $foo is altered too.
echo $foo;
?>
18. PHP: Functions
(global statement)
<?php
$foo = 1;
bar(); // call function
function bar()
{
global $foo;
$foo++;
echo "$foo in function bar() = " . $foo."n";
}
echo "$foo in main = " . $foo."n";
?>
Outputs
$foo in function bar() = 2
$foo in main = 2