What does a 'PHP Warning: Division by zero' error mean in CodeIgniter?

Question

Grade: Education Subject: Support
What does a 'PHP Warning: Division by zero' error mean in CodeIgniter?
Asked by:
70 Viewed 70 Answers

Answer (70)

Best Answer
(307)
This error happens when you attempt to divide a number by zero in your PHP code. This is a mathematical error, and it usually indicates a logic flaw in your code. Before performing the division, check if the denominator is zero, and implement a conditional statement to prevent the division from occurring.