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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -