Join Nostr
2026-05-25 11:35:04 UTC

Terence Eden on Nostr: 🆕 blog! “PHP - simple way to send HTTP headers before a script ends” Suppose ...

🆕 blog! “PHP - simple way to send HTTP headers before a script ends”

Suppose you want PHP to keep processing after it has sent back an HTTP response. Normally, this doesn't work:

<?php
header( "Location: https://example.com/"; );
// Long operation.
sleep(10);
die();

Try it yourself. You'll have to wait 10 seconds before you get back

< HTTP/2 302
< …

đź‘€ Read more: https://shkspr.mobi/blog/2026/05/php-simple-way-to-send-http-headers-before-a-script-ends/
⸻
#HowTo #php