PHPでtry~catch文
2014/07/02
PHPでもあるってのを知らなかったのでメモ。
■参考サイト
http://www.php-ref.com/basic/06_try_catch.html
<?
try {
//例外処理
} catch (Exception $e) {
echo $e->getMessage();
}
?>
関連記事
-
-
PhpSpreadsheetでセル内の文字列の改行、セル幅の自動調整を行う方法
以前PHPとPhpSpreadsheetを用いてExcelシートを出力する方法を ...
-
-
PHPで「Warning: date(): It is not safe to…」エラーの対応方法
PHPでdate関数を使った際に「Warning: date(): It is ...
-
-
Facebookのタイムラインを取得して表示する方法
Facebookのタイムラインを取得してきて、表示させたいという案件があった。 ...
-
-
PHPでプロキシ経由で他サーバーに接続する方法(file_get_contents / curlの2パターン)
PHPでfile_get_contentsやcurlで他サーバに接続する際に自サ ...
-
-
PHPで配列を確認する際にvar_dumpよりも見やすくなるdBug.phpの利用方法
PHPで配列を確認する際、大抵var_dumpで出力させているがこれが見づらい。 ...