FIRST : Opening tag
<?phpthis tag opens a php document, it tells the browser that when it reaches that string start reading as php. An alternative is [code[<?[/code] however some older php versions don't accept this and read is as a string of text. So it's safer to use
<?php.
Ending tag
--------
Next is the ending tag.
?>simple eh? That tells the browser to stop reading it as PHP code.
Variables
--------
A variable in PHP is just like a variable in Algebra (if you don't know Algebra it doesnt matter)
It has a value.
$variable=papathat is an example of a variable, it assigns $variable the value papa. An example of how you could use this is
<?php $variable=papa; echo '$variable'; ?>That would echo the word papa on the page, notice after every php statement I put a ';' this is important as it tells the browser to end that statement.
Echo
-----
Notice in the above example I used 'echo', echo is a php function that "echos" something, in other words display it. you might see sometimes 'print', it is the same thing, how you use it is basically a matter of preference.
That concludes this tutorial, maybe later I might write a bit more indepth tutorial covering functions, mysql integration, and other things. Thanks.
this tutorial was made by someone on my staff. for more please visit www.kev-designs.com