Source Code:
(back to article)
<?php try { // code that might throw an exception throw new Exception('An error has occurred.'); } catch (Exception $e) { // code to handle the exception echo 'Error: ' . $e->getMessage(); } ?>
Result:
Report an issue