PHP – Basic Syntax

Some questions inside the online test software are not accepting the code format properly.

1.Which of the following starts a PHP block?”  

a) <?php
b) <php>
c) <%
d) {php}

Correct Answer: a

2. Which tag is used for short echo in PHP?
a) <?php echo ?>
b) <?= ?>
c) <php=>
d) <$>

Correct Answer: b


3. Which is NOT a valid PHP tag?”
a) <?php ?>
b) <? ?>
c) <% %>
d) <scriptphp> </scriptphp>

Correct Answer: d


4. Which tag closes PHP?”
a) </php>
b) ?>
c) {/php}
d) </?>

Correct Answer: b

error: Content is protected !!