Whats wrong with my code?


String Functions II

Please check my code. This looks correct and should let me pass to the next topic, but it isn't. The error I am getting is: "Oops, try again. Your first strpos() call should output a number. "

    // Print out the position of a letter that is in
    // your own name
    // Check for a false value of a letter that is not
    // in your own name and print out an error message
    if strpos("gama","y")=== false)
         print "Sorry, no 'h' in 'david'";


Try to use
print strpos("gama","m");


I am getting the same error message still


In your

you are missing an opening-paranetheses-(

if (strpos("gama","y") === false)


you nailed it. thank you buddy :slight_smile:


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