Posts Tagged PHP

PHP’s Classes and Objects

blocksBefore start working with classes and objects, we must first know the difference between traditional programming and object oriented programing (OOP).  In traditional programming problems are solved performing one action after the other, in other words, you write a program where some actions are executed one by one to solve a problem.

For Example,  if you want to add two numbers in PHP, it’s enough the following code:

<?
// Define the numbers
$a = 2;
$b = 3;
// Add both numbers
$c = $a + $b;
echo "a+b=".$c;
?>

Read the rest of this entry »

,

4 Comments