Hi everyone,
while retrieving function I am getting parse error,could you please go through this code and suggest me if I did any mistakes for calling a function in PHP.
Here is code:
<?php
class test{
function add(){
var $a=100;
var $b=200;
var $c = $a + $b;
return $this->c;
}
function substraction(){
var $a=100;
var $b=200;
var $c = $a - $b;
return $this->c;
}
}
$test=new test();
var $a=$test->add();
echo $a;
var $s = $test->substraction();
echo $s;
?>
Leela