<?php
try {
if (file_exists('test_try_catch.php')) {
require ('test_try_catch.php');
} else {
throw new Exception('file is not exists');
}
} catch (Exception $e) {
echo $e->getMessage();
}
具體使用場景:
文章來源:外星人來地球
歡迎關注,有問題一起學習歡迎留言、評論