Is there something wrong in my code?


#1







<?php
$fruit = "Apple";

switch ($fruit) {
    case 1 'Apple':
        echo "Yummy.";
        break;
default:
    echo "Not Yummy.";
}

?>
</body>

I'm getting this Error!
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 11


#2

Hi
There is a "1" in the case which should not be here. You should write case 'Apple': instead of case 1 'Apple':
Cheerio


#3

Thanks a Lot! This make it work!