Sunday, March 24, 2013

PHP Basic -> Control Structures


Control Structures: These are those things which control how the program "flows". Control are very important for any language whether it is PHP OR C.

  • if
  • else
  • elseif/else if
  • while
  • do-while
  • for
  • foreach
  • break
  • continue
  • switch
  • declare
  • return
  • require
  • include
  • require_once
  • include_once
  • include
  • include_once
  • goto
I hope you are aware of above all.



Following are the property of Control constructs.
  • Parenthesis are optional means include "class.php" or include ("class.php") both work.
  • these are faster as compare to Normal function like strstr, array_merge etc. 

Following things keep in mind regarding this topic(Minimum)
  • Difference between include, include_once, require and require_once
  • Deprecated control structessuppress the error 
  • What is use of declare
  • Difference between continue and break
  • Why use return in functions of PHP. 



No comments:

Post a Comment