What function is used to output text in PHP?
Correct answer
B. echo()
14 views
B. echo()
14 views
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.
Not sure why the answer is B? Ask here and get an explanation.