Skip to content

Instantly share code, notes, and snippets.

@stungeye
Created June 1, 2015 17:46
Show Gist options
  • Save stungeye/3f20740ecea16222a36a to your computer and use it in GitHub Desktop.
Save stungeye/3f20740ecea16222a36a to your computer and use it in GitHub Desktop.
Hello World PHP Test Script
<?php
$highlighted_source = highlight_file(__FILE__, true); // Documentation for this function listed below.
?>
<!DOCTYPE html>
<html>
<head>
<title>Hello World PHP Demo</title>
</head>
<body>
<?php for($i = 0; $i < 3; $i++): ?>
<h2>Hello World PHP Demo</h2> <!-- HTML can be dynamically added to the page. -->
<?php endfor ?>
<h1>The Highlighted Source Code</h1>
<?= $highlighted_source ?> <!-- This is a PHP variable being echoed into the page. -->
<h1>Technical Details</h1>
<p>Apache executes the PHP code between &lt;?php and ?&gt; tags before sending the file over HTTP.</p>
<p>Reference: <a href=" http://php.net/manual/en/function.highlight-file.php">highlight_file documenation</a></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment