3. String Function ||


#1



I'm not sure what I did wrong with the code. I tried using the examples to help me. I erased it and redid it and I tried to refresh the page. Nothing is working though.

My code:


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


#2

Print out the position of a letter...

    print strpos("Jenny", "e");

Just print one value.


#3

It worked!

I replaced
strpos("jenny", "j");
strpos("jenny", "e");
strpos("jenny", "nny");

with

print strpos("Jenny", "e");

Thank you so much!!!


#4

Ohh GOD, Thank you! :wink:


#5