when you will get the message/error "headers already sent"?

Answer Posted / dhiraj

when we are using the session variable..and want to start
our session.. we use session_start(); in the very first
line.
anything occur before this line, even a single space we get
the headers already sent error.
To overcome this problem, we can use ob_start(); at the
very first line and ob_end_flush(); at the end of the
script..

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mysql_fetch_array?

521


What are the string function in php?

509


I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

481


Is php faster than nodejs?

489


what is the use of include_once in php?

532






What's the output of the ucwords function in this example?

552


What is print_r?

510


Which is faster for or foreach?

506


How To Get the Uploaded File Information in the Receiving Script?

585


What is final in php?

525


What is the use of strpos in php?

552


Which php framework is fastest?

506


What are the data types in php?

541


What is the empty function?

540


What is preg_match?

540