<!DOCTYPE html><html><head><title>First PHP Example</title></head><body><h1>Our First Example</h1><?php// Ask PHP to print all errors and warnings// This is very helpful when developingerror_reporting(E_ALL);ini_set('display_errors',1);// comments# comments/**
* comments
*//*
comments
*/echo"Hello world!<br>\n";echo"Again!";$var="5 apples";functioncontext($var){return"Variable: $var, type: ".gettype($var)."<br>\n";}echocontext($var);$var+=64;echocontext($var);$var.=" apples";echocontext($var);$var=(int)$var;echocontext($var);$var*=5.1773467;echocontext($var);$var=(int)$var;echocontext($var);for($i=0;$i<5;$i++){$foo=5;?><h2>Hi!</h2><!-- don't do this! --><?php}// Unset $i or else it will persistunset($i);echo"After the loop \$i = $i<br>";// $foo persists!echo"After the loop \$foo = $foo<br>";// Check whether $i is null (will be after unset())if(is_null($i))echo"i was null";?></body></html>