Friday, March 22, 2013

PHP Basics -> Syntax

How to Start PHP?
PHP is one of the famous server side language used to created dynamic web pages. For quick start install wampserver OR xampp server.

PHP Syntax
PHP Start with "<?php" and end with "?>"


PHP Single Line Comments
Following line will not print the statement i.e "Hello World" to the browser.
//echo "Hello World";


PHP Multiple Line Comments
/*
for($i=1; $i<=10; $i++){
echo "{$i}";
}*/


Following things keep in mind regarding this topic(Minimum)

  • How to declare  Array, String and Object variable.
  • How to access and  "add element" in array  object variable and manupulation on string variables.
  • How to write function syntax and use user defined functions.
  • Loop like For, While and Do while.
  • Closing of PHP tag is not compulsory in one line php code.
  • Single line, Multiple line comments
  •  What are the PHP different type of error like syntax error, warning, notice and user defined error etc.
  • Difference between single quoted comments and double quoted comments
  • How to store php value in variable instead of send the output to the browser.
  • How to parse variable in single quoted string and double quoted string.
  • PHP coding conventions like there must be spaces after and before of equal (=)

No comments:

Post a Comment