php class and object code example
Example 1: oops concepts in php
The PHP Object-Oriented Programming concepts are:
Class
Objects
Inheritance
Interface
Abstraction
Magic Methods
Example 2: php object
$obj = [
"example1" => 1,
"example2" => "two",
"example3" => [
"example4": true
]
]
Example 3: php class
var array = [1, 2, 3, 4, 5, 6],
s = 0,
p = 1,
i;
for (i = 0; i < array.length; i += 1)
{
s += array[i];
p *= array[i];
}
console.log('Sum : '+s + ' Product : ' +p);