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にて同一サーバの別ディレクトリでセッションを振り分ける方法
同じサーバ内にmemberとownerの別ディレクトリがあり、それぞれにsess ...
-
-
PHPでJSONデータを見やすく整形した上で表示させる方法
PHPで何らかのデータをjson_encodeでJSONに変換し、そのままech ...
-
-
PHPのsetcookieで「Cannot modify」エラーの対応方法
PHPでsetcookieを使うと「Warning: Cannot modify ...
-
-
PHPで「Call to undefined function mb_str_split()」エラーの対応方法
PHPにて「Fatal error: Uncaught Error: Call ...
-
-
formのinput="file"でディレクトリを選択させ、ディレクトリ内のファイルを全てアップロードする方法
フォームで複数のファイルをアップロードしたい場合、input="file"を複数 ...