http_response_code() 无法正常运行

http_response_code() not functioning properly

目标:将 php 中的 http_response_code404 更改为 200

我目前正在使用

<?php
http_response_code(200);
?>

但是httpstatus.io还在拉404

小丑。

有什么建议吗?

这表明您 httpstatus.io 指向了错误的页面。如果它是 404,则意味着您的 PHP 代码不在您正在查看的 URL 处,因此 http_response_code() 方法将不起作用。检查您的页面地址是否准确。