php - headers_sent() return false, but headers were sent -


my code simple:

<!doctype html> <html>   <head>     ...     <?php var_dump(headers_sent()); ?> 

it returns false. shouldn't headers sent after printed? after first < character.

it depends if output_buffering directive in php.ini file. if off

output_buffering = off

then echo headers_sent() should output 1

in other cases, headers_sent() won't output results because false. headers won't sent because output buffered.

if want around , force-send headers, can use flush().

hope helps!


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -