Sometimes my code breaks and it is out of my control
How would I do the following?
try { //do my stuff } catch { //sleep and try again }
To be able to catch an exception you have to first throw one. Something like this.
getMessage(), "\n"; } // Continue execution echo "Hello World\n"; ?>
There are certain built in exceptions : http://php.net/manual/en/spl.exceptions.php