PHP Tutorial 101: Hello World!

... published April 23, 2007

PHP - Hypertext PreProcessorSo, here it is, my first tutorial ever!
I will try to explain how to create your first PHP “script”.

Requirements for the PHP Tutorials:
- at least good knowledge about HTML
- Webspace or local server with PHP Support
- Additional: knowledge about CSS
—————————————–

Well, let’s start with the script itself, I will explain everything later:

<?PHP
echo "Hello World!<br />";
print 'Hello World!<br />';

echo "<a href=\"http://www.ruelicke.net\">Hello World link</a><br />";
print '<a href="http://www.ruelicke.net">Hello World link</a>';
?>

Create a HTML file, insert the code above into the <body> and save it. Then rename the HTML file from foo.html to foo.php
Upload the file and access it.

If everything is working, then you should see “Hello World” (without the quotes) 4 times. Congratulations, looks like you just wrote your first PHP script.
Continue…