Try Catch Finally
The finally block executes regardless of whether an exception occurs.
Example
Section titled “Example”try {
echo "Executing code";
} catch (Exception $e) {
echo $e->getMessage();
} finally {
echo "Cleanup executed";
}