400 Error in PHP


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:


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


That does the trick! Thanks!