catch error exception php
try {
do some thing evil
} catch (Error $e) {
echo 'Now you can catch me!';
}<?php
function inverse($x) {
if (!$x) {
throw new Exception('Division durch Null.');
}
return 1/$x;
}
try {
echo inverse(5) . "\n";
echo inverse(0) . "\n";
} catch (Exception $e) {
echo 'Exception abgefangen: ', $e->getMessage(), "\n";
}
// Ausführung fortsetzen
echo "Hallo Welt\n";
?>
Also in PHP:
- date("H:i:s"); is js or php
- array count items
- display date format in php
- error reporting on in php
- cache;clear laravel
- Arr::get laravel
- drupal composer update
- date('d')
- php switch break
- compile php 7.4 from source in ubuntu 20
- actual date php
- codeigniter validation text length
- check substring in string php
- $db php
- composer instal laravel
- default header value in php
- determine with index has a value in php
- clear cache is not working laravel
- base64 to image
- convert to int php
- css date function
- find first occurance of sentence in a string php
- convert time() to date php
- Auth()->user()->id;