Hi i can understand what is going on here , but want to know the purpose ,
in this switch case statement
<?php
switch(1) {
case 1: print("Book Details<br />");
case 2: print("Book Author<br />");
default: print("Missing Book<br />");
}
?>
the result is
Book Details
Book Author
Missing Book
my expected result was
Book Details
Missing Book
My question is that
*in switch statement we are checking switch(1)
, so how is it possible to execute case 2:
default should print and i can understand that .
is there any particular reason to this ?
please explain , thanks in advance .