Print out a useful error


#1

https://www.codecademy.com/courses/web-beginner-en-7I7Xm/0/3?curriculum_id=5124ef4c78d510dd89003eb8#

"Oops, try again. You should print out a useful error message for the failed strpos() call."

What error message does it want? Why is it so picky?


<html>
    <p>
    <?php
    // Print out the position of a letter that is in
    // your own name
    $test = print strpos("etvoi", "i");
    ?>
    </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 ($test === false) { 
        print "error";
    }
    ?>
    </p>
</html>


#2

I'm dumb, it wanted me to fail a test

"""


<?php
// Print out the position of a letter that is in
// your own name
$test = print strpos("etvoi", "e");
?>



<?php
// Check for a false value of a letter that is not
// in your own name and print out an error message
if (strpos("etvoi", "z") === false) {
print "error";
}
?>



"""

#3

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