Teorija
Ukoliko već niste, prvi je korak pogledati službenu stranicu o php Exceptionima na http://php.net/manual/en/language.exceptions.php. Osim nekih php specifičnosti tu imate i primjer osnovne upotrebe try catch blokova i rada sa exceptinima.
Primjer upotrebe ide ovako:
<?php
function inverse($x) {
if (!$x) {
throw new Exception(‘Division by zero.’);
}
else return 1/$x;
}
try {
echo inverse(5) . “\n”;
echo ...Continue Reading »

