Hello PHP!
- Open Xcode 2.0 (/developer/applications/Xcode.app).
- Open a New Empty File (^zN).
- Type the following exactly as it appears.
<?php
$title = 'Hello X World III';
?>
<html>
<head>
<title><?php print $title ?></title>
</head>
<body>
<h1><?php print $title ?></h1>
<?php
phpinfo();
?>
</body>
</html>
Note: You can turn on syntax colouring for PHP from the Format menu in Xcode 2.0 (Format -> Syntax Coloring -> PHP)
- Save the file with the name hello.php in /Users/[shortname]/Sites/.
- Open Safari and type in the address http://localhost/~[shortname]/hello.php and hit enter.