I used header redirect between ob_start and ob_clean, but it still redirected.
I just want to know why ob_clean() doesn't work.Thank you!
ob_start();
header("location:../index.html");
ob_clean()
ob_end()
I used header redirect between ob_start and ob_clean, but it still redirected.
I just want to know why ob_clean() doesn't work.Thank you!
ob_start();
header("location:../index.html");
ob_clean()
ob_end()
This is because output buffering doesn't affect headers.
The manual for ob_start says:
While output buffering is active no output is sent from the script (other than headers)
(my bold).
Therefore ob_clean()
doesn't remove the header which you created.