6. All on your own! (Why isn't it working?'


#1

Can anyone explain why this isn't working? Thanks~

    switch ($colour) :
     
        case 'red':
            echo 'We do have this colour, please wait a moment';
            break;
        case 'purple';
            echo 'I can check for you'; 
            break; 
        case 'Yellow';
            echo "We aren't allow to sell that sir"; 
            break; 
        default:
            echo 'We do not have that bro'; 
    endswitch;



#2

Check your lines with case, they should end in :.


#3

Reading your reply helped me fix mine too. Silly mistake!

Thanks.


#4

Oh boy, still not used to the syntax... Thank you!


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.