PHPでtry~catch文
2014/07/02
PHPでもあるってのを知らなかったのでメモ。
■参考サイト
http://www.php-ref.com/basic/06_try_catch.html
<?
try {
//例外処理
} catch (Exception $e) {
echo $e->getMessage();
}
?>
関連記事
-
-
PHPでファイルアップロード時にディレクトリトラバーサル攻撃の対策をする方法
あるシステムのセキュリティ対策としてディレクトリトラバーサル(Directory ...
-
-
PHP8系で「Warning: Constant xxxxx already defined in」エラーの対応方法
PHP8系&WordPress6.4.3で「Warning: Const ...
-
-
PhpSpreadsheetでセル内の文字列の改行、セル幅の自動調整を行う方法
以前PHPとPhpSpreadsheetを用いてExcelシートを出力する方法を ...
-
-
PHPで「Unable to allocate~」とエラー
PHPで「Unable to allocate memory for pool」 ...
-
-
PHPでランダムな値を取得したいケース諸々の対応方法
テストデータを作成する際にランダムな値を入れたかったけど、色々ケースがあったので ...