php get error message try catch 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;
}