Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, April 25, 2013

Codecademy Sample Solution: String Functions II



<html>
    <p>
    <?php
    // Print out the position of a letter that is in
    // your own name
    $name = "Anonymous";
    print strpos($name, "o");
    ?>
    </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($name, "z")===false){
        print "The letter 'z' was not found in $name.";
    }
    ?>
    </p>
</html>

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts