1. Home
  2. Computer Science MCQs
  3. PHP
  4. A PHP script should start with ___ and end with ___:

Added 19 Jan 2024

A PHP script should start with ___ and end with ___:

  1. < php >
  2. < ? php ?>
  3. <?php ?> Correct answer
  4. <?!-- ?>

Correct answer

C. <?php ?>

12 views

MCQSEXAM

Explanation

A PHP script starts with <?php and ends with ?>. Everything between these tags is executed by the PHP engine, while anything outside them is sent to the browser unchanged.

In a file that contains only PHP code, the closing ?> tag is usually left out to avoid accidental whitespace being sent as output. The other options are not valid PHP delimiters.

Keep preparing with more Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs