Tuesday, October 22, 2013

PHP Basic sintax

The sintax in PHP is basically how we write the code, and it isn’t complicated at all. If you are already a programmer, you might find the sintax in PHP similar to other languages, such as C or Java, if not, then checkout these simple rules that will help you start with PHP.

How to write code in PHP…

Look at the following example and the description to understand the rules.
01<?php
02
03/*when coding in php, we must always specify that we are writing php by typing "<?php"*/
04//you can type in comments by using double slash "//", that way you can comment a complete line
05
06/*when needed use slash asterisc, to start a big comment, which is considered finished when closed, just like in this example.*/
07
08echo "hello people!";
09/* every set of instructions may be ended with semicolon ';' */
10
11/*when we no longer want to write in php, close the PHP instructions only by typing  "?>"*/
12?>

Besides that you may wan’t to see this next video for a more visual explanation.
Basic sintax in php video tutorial
That would be all for now, hope you guys found this post useful, don’t forget to comment below!