PHP死的问题

Señ*_*cis 4 php die

只是一个简单的问题.说一个像这样的方法

mysql_pconnect("server","tator_w","password")
               or die("Unable to connect to SQL server");
Run Code Online (Sandbox Code Playgroud)

我可以将'die'调用方法而不是显示短信吗?如果是这样,怎么样?

Tom*_*igh 6

如果你想做更复杂的事情,你最好使用if语句而不是依赖于短路评估,例如:

if (!mysql_pconnect("server","tator_w","password")) {
    call_a_function();
    //some other stuff
    die(); //if you still want to die
}
Run Code Online (Sandbox Code Playgroud)