勉強したことのメモ

Webエンジニア / プログラマが勉強したことのメモ。

PHPでtry~catch文

   2014/07/02  PHP

PHPでもあるってのを知らなかったのでメモ。

■参考サイト
http://www.php-ref.com/basic/06_try_catch.html

<?
try {
//例外処理
} catch (Exception $e) {
echo $e->getMessage();
}
?>

 - PHP

  関連記事

PHPで「operator not supported for strings」エラーの対応方法
PHPで「operator not supported for strings」エラーの対応方法

PHPにて「Fatal error: [] operator not suppo ...

PHPで簡単にカレンダーを生成できるライブラリ「PHP Calendar」の利用方法
PHPで簡単にカレンダーを生成できるライブラリ「PHP Calendar」の利用方法

PHPでカレンダーを描写したいということがたまにある。今までバニラPHPで書いて ...

PHPからLINEのMessaging APIにリクエストし通知を送る方法
PHPからLINEのMessaging APIにリクエストし通知を送る方法

LINEから「2025/3/31にLINE Notifyのサービスが終了する」と ...

PHPにて同一サーバの別ディレクトリでセッションを振り分ける方法
PHPにて同一サーバの別ディレクトリでセッションを振り分ける方法

同じサーバ内にmemberとownerの別ディレクトリがあり、それぞれにsess ...

PHP8系で「Warning: Constant xxxxx already defined in」エラーの対応方法
PHP8系で「Warning: Constant xxxxx already defined in」エラーの対応方法

PHP8系&WordPress6.4.3で「Warning: Const ...