Multiple choice technology web technology

How do you write "Hello World" in PHP

  1. printf("Hello World")

  2. echo "Hello World";

  3. "Hello World";

  4. Document.write("Hello World");

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

echo is the correct way to output text in PHP. While printf also works for formatted output, echo is the standard method for simple string output and is the most commonly used. Option C is just a string literal without an output command, and option D uses JavaScript syntax.