Can someone please recommend a solution? Thanks


For some reason, I am getting an error message about not using a 'useful error message'

Please, help!


Hi your if statement should have that strutture

if (condition) {
    #do something


Thanks for your reply! Your suggested solution does not work,

If (condition):


is a valid form of writing conditional statements in PHP

The error I am getting is from the strings i am using in my output when the condition is false. It seems like theres a specific message they want me to output.

Thanks again for your help.


Try to refresh the page


still getting the same error message, lol


Please paste in your code then I can help you




oops, realized you want the code. Here you go:

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


Its because your strpos() should be false so that the equality is evalue to true

strpos("Potrobas", "r") ==> true

So in your if statament you have

if (true === false)

which is false so the print inisde the if statement isn't run.
you should change the r by an other letter that isn't inside your name.


You're absolutely right! Thanks! I am actually amazed i didn't see that, lol