Quick php tutorial
HELLO WORLD
1) Open a basic text editor like notepad
2) Insert our php opening and closing tags
3) Paste the code below between the tags
4) Save the file as helloworld.php and upload it to a web server with php installed
5) Navigate to the location in your browser
6) You should now see this
So what did each part of the script do?
Well the <?php and ?> tags tell the php parser to parse anything between them before sending to the browser
The "//hello world comment" is what is known as a comment and is ignored by the php parser. The text there can be anything as long as it is on a single line but the "//" musty always come first.
The 'echo "Hello World!";' Is a function used to output html to the browser. Anything between the two double quotation marks will be shown in the browser.
And thats the end of that tutorial!
HELLO WORLD
1) Open a basic text editor like notepad
2) Insert our php opening and closing tags
PHP:
<?php
?>
3) Paste the code below between the tags
PHP:
//hello world comment
echo "Hello World!";
4) Save the file as helloworld.php and upload it to a web server with php installed
5) Navigate to the location in your browser
6) You should now see this
Hello World!
So what did each part of the script do?
Well the <?php and ?> tags tell the php parser to parse anything between them before sending to the browser
The "//hello world comment" is what is known as a comment and is ignored by the php parser. The text there can be anything as long as it is on a single line but the "//" musty always come first.
The 'echo "Hello World!";' Is a function used to output html to the browser. Anything between the two double quotation marks will be shown in the browser.
And thats the end of that tutorial!