Files
freeCodeCamp/guide/chinese/php/functions/die-and-exit/index.md
2018-10-16 21:32:40 +05:30

22 lines
550 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Die and Exit
localeTitle: 死亡和退出
---
## 死亡和退出
`die()``exit()`函数是相同的。它们每个都带有一个包含错误消息的参数(一个字符串)。在运行时,它们输出消息并立即停止执行脚本。
```PHP
<?php
die('Die() function was run');
```
```PHP
<?php
exit('Exit() function was run');
```
#### 更多信息:
* [php.net die手册](https://secure.php.net/manual/en/function.die.php)
* [php.net exit手册](https://secure.php.net/manual/en/function.exit.php)