1. Home
  2. Computer Science MCQs
  3. PHP
  4. What function is used to output text in PHP?

Added 23 Jan 2024

What function is used to output text in PHP?

  1. printText()
  2. echo() Correct answer
  3. display()
  4. outputText()

Correct answer

B. echo()

14 views

MCQSEXAM

Explanation

echo is used to output text in PHP, for example echo "Hello";. Strictly it is a language construct rather than a function, so the parentheses are optional.

print works in a similar way but returns a value and accepts only one argument. printText(), display() and outputText() are not part of PHP.

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

Doubts & discussion

Not sure why the answer is B? 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