Using code in codeigniter, php:
class test extends CI_Controller {
public function index(){
eval( '$amt = (' . $arithmetic_formula . ');' );
}
}
getting error:
Warning Message: Division by zero
The variable $arithmetic_formula
is a dynamic formula which can be change by the user anytime. And sometime we are having zero in the formula in which we don't have any control, that's why we are getting the error.
How can I deal with the above error, please help if anyone knows.
Thanks in advance !