Which of the following is a valid way to start a PHP session?
Correct answer
C. session_start()
12 views
C. session_start()
12 views
session_start() starts a new session or resumes the existing one, and must be called before any output is sent to the browser because it sets a cookie header.
After it runs, the $_SESSION array becomes available. The other names in the options look plausible but do not exist in PHP.
Practise more Computer Science MCQs with answers and explanations on MCQsExam.com.
Not sure why the answer is C? Ask here and get an explanation.