Whats wrong with my code?


#1


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. "


 <?php
    // Print out the position of a letter that is in
    // your own name
    
    strpos("gama","m");
    ?>
    </p>
    <p>
    <?php
    // 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'";
    }
    ?>


#2

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


#3

I am getting the same error message still


#4

@glenn11,
In your

you are missing an opening-paranetheses-(
like

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

#5

you nailed it. thank you buddy :slight_smile:


#6

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