JF0 2019-12-18
1,系统自带异常类 try catch
<?php
try{
throw new Exception(‘96net.com.cn‘,10);
}catch(Exception $e){
echo $e->getMessage();
echo $e->getCode();
}
2,自己创建异常类
<?php
class MyException extends Exception{
function demo(){
echo "dc3688.com";
}
}
try{
throw new MyException(‘96net.com.cn‘,10);
}catch(Exception $e){
echo $e->getMessage();
echo $e->getCode();
echo $e->demo();
}
<?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh
test-f /etc/resolv.conf &&echo"File /etc/resolv.conf found."||echo"File /etc/resolv.conf not found."