我有一个web服务器,在某些情况下,我希望拥有HTTP状态代码418"我是茶壶",我确信我会使用if语句,我只是似乎无法让它跳闸,有什么帮助吗?
<?php
header("HTTP/1.1 418 I'm a teapot");
?>
<html>
<h1>418 I'm a teapot</h1><br>
<p>The HTCPCP Server is a teapot. The responding entity MAY be short and stout.</p>
</html>
将导致:
418我是个茶壶
HTCPCP服务器是一个茶壶。作出回应的实体可能又短又胖。