How can I use a try-catch block in PHP? Example code: - Biz Tech

How can I use a try-catch block in PHP? Example code:

Listen
try {
    // Code that may throw an exception
    $result = 10 / 0;
} catch (Exception $e) {
    // Code to handle the exception
    echo "An error occurred: " . $e->getMessage();
}