<?php 
    header('Content-type:text/html;charset=utf-8');
    $a 1;
    $b 2;
    try {
        //结果为真,设置异常信息
        if$a $b )
        {
            throw new Exception('a要大于b');
        }
    } catch (Exception $err{
        // 返回异常信息
        echo $err->getMessage();
    }
?>

相关文章:

  • 2022-12-23
  • 2021-05-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-09-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2021-10-22
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案