PHP - Basics and Execution Model
You want to write a PHP program that prints "Hello World!" and then prints "Welcome to PHP." on the next line. Which code is correct?
<?php echo "Hello World!"; echo "Welcome to PHP."; ?>correctly uses two echo statements with semicolons.
<?php echo "Hello World!\nWelcome to PHP."; ?>uses \n inside double quotes but PHP does not automatically print new lines in HTML output.
<?php print "Hello World!" print "Welcome to PHP."; ?>misses semicolon between print statements.
<?php echo "Hello World!" echo "Welcome to PHP."; ?>misses semicolon after first echo.
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions