Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$a = 10;
if (1) 
    print "all";
else 
    print "some"
else 
    print "none";
?>

A. all

B. some

C. error

D. none

Answer: Option C

Solution(By Examveda Team)

Hanging else statement.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)