try-catch PHP

php

http://net.tutsplus.com/tutorials/php/the-ins-and-outs-of-php-exceptions/

function doSomething() {
    throw new Exception('blah');
}
try {
    doSomething();
} catch (Exception $e) {
    echo $e->getMessage();
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License