Should I use ob_start() before session_start() or session_start() before ob_start()?
Should I use ob_start() before session_start() or session_start() before ob_start()?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It really doesn’t matter.
session_start()will not output anything (except for an error if something goes wrong) so the output buffer will not be affected either way. My script runssession_start()first simply because it loads that file first (alphabetical order).To me, this seems like saying ‘should I define
$a = 1or$b = 2first?’ when in the end$c = $a + $bwill always be the same.