PHP: Basics
In this tutorial I will explain:
•Opening and closing tags of PHP…
•Other basic tags…
•And an example of a PHP page.
The only way of starting a PHP script is to first type <?php. The content goes in between that tag and the ending tag which is, ?>.
Example:
-
<?php
-
/* This is a comment block */
-
echo ‘Hello World’;
-
?>
A comment block is any text that you would like to include in a PHP page without it having an affect on the page itself. You can use comment blocks to help you locate information in a certain page so that your not scrolling for such a long time looking for a certain part of the page.
The text ; is used to end a string or anything and everything in a PHP script. You must use this to declare the end of every statement (Declaring variables, Echoing, etc..).
Echo is a function used to output text and data. You use it to display variables, strings, and even HTML code. When you start to echo something you do it as follows: echo ‘ content to be displayed goes here’;. Don’t forget to end the statement with a semi-colon.

























Coding College » The 7 Ultimate Reasons To Learn PHP said
am April 22 2008 @ 6:24 pm
[…] tons of tutorials out there; I suggest starting out with an introduction to PHP, then moving on to PHP basics. If you can’t find what your looking for on CodingCollege just leave a comment and we will […]