In myClass I have declared $_total_results_found = 0
Then in my function I changed the value of $_total_results_found = 10
But, when I try to call this outside myClass the value still shows me 0.
Please can any one help me how to write this code?
class myClass
{
private $_total_rows_count = 0;
public function foundResults()
{
$count = 10;
$this->_total_rows_count = $count;
}
} // end myClass
$myclass = new myClass();
echo $myclass->_total_results_found; // Value is showing 0 instead of 10