The Syntax Struggle is Alive and Real


Syntax error on line 8 is the error message. Could someone please show me what is messed up? Thanks

     $name = "jake":
    switch ($name):
    case ($name = "harry"):
    case ($name = "jake"):
    case ($name = "meg"):
         print "mmmm yeh";
    case ($name = "jessica"):
         print "ohhh yes";
    case ($name = "madeline"):
        print "hey";
    default: print "love me love me"


This -> $name = "jake": is a simple assign operation, you should end it with a semicolon, not a colon.

You have opened and ended your switch statement in the incorrect way. Take a look at the documentation to find the correct syntax ->


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