400 Error in PHP

Hey,

Is there a way to set the HTTP status to 400 in PHP? I’ve tried a few methods but none seem to work.

I have a Glitch PHP project where I’ve had luck with this technique:

http_response_code(400);

If that doesn’t work, maybe post your project and I can give a hand :slight_smile:

Should work in any version of PHP 5.4+ or 7

https://www.php.net/manual/en/function.http-response-code.php

That does the trick! Thanks!