catch erro message php code example
Example: php throw exception
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}