Friday, 1 April 2016

Week 6



For week 6, we learned about PHP which is one of the server-side script language. PHP scripts can be embedded within HTML to create dynamic and interactive web pages. PHP is an open source, easy to use, can be installed in multiple platforms and database supported.
PHP Basic Syntax 
 <?php      PHP code goes here      ?>
<?        PHP code goes here       ?>
<script language=php PHP code goes here  </script>



 PHP basics include:
1.   Variables and Data Types
  • must begin with a $
  • they are case sensitive
  • Loosely typed language. It can be a number(integer/floating point) or a string of text or Boolean values.
2.   Operators

Comparison Operators

Arithmetic Operators

Logical Operators

3.   Conditional Statements and Loops
  • if statement










  • if-else and elseif statement
  • switch statement


  • for loop 
  • while loop


  • do-while loop 
  


4.   Functions
  • A function is a piece of PHP code that perform a useful task, and usually return a value related to that task. 
  • it can be executed once or many times by the PHP script. 
  5.   Arrays
  • An array is a variable that can contain multiple values under a single variable name.
  • It is useful for storing a group of related values.

For the lab session 

We have done some exercises on the PHP topic. 





No comments:

Post a Comment