String Functions II - Still throwing " Oops, try again. Your first strpos() call should output a number."


#1

I've tried every [SOLVED] I could find on these boards and must be missing something.

Here's my code:

<html>
    <p>
    <?php
    // Print out the position of a letter that is in
    // your own name
    $name = strpos("benjamin", "j");    
        print $name;
    ?>
    </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("benjamin" "z") === false) {
        print "Sorry, no 'z' in 'benjamin'";
    }
    ?>
    </p>
</html>

Can anyone see an error with my code? Please help!

Thanks in advance for the assistance :slightly_smiling:


#2

@living_legend

I guess there's a comma between "benjamin" and "z". You should also try refreshing your webpage because the code editor in php course is really buggy.


#3

Perfect! It worked. Thanks for the solution :slightly_smiling: )