Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はPHPコードに従っています
<?php header("HTTP/1.0 200 OK"); if(headers_sent()){ echo "Header Sent"; } else{ echo "Header Not Sent"; } ?>
それでも「Header Not Sent」というメッセージが表示されます。
応答コードが送信されないことを意味します。それを解決する方法は?
ヘッダー使用前ob_start();と使用後ob_end_flush();
ob_start();
ob_end_flush();
ob_start(); header("HTTP/1.0 200 OK"); ob_end_flush(); if(headers_sent()){ echo "Header Sent"; } else{ echo "Header Not Sent"; }