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

Thursday, April 25, 2013

Codecademy Sample Solution: Show What You Know!



<html>
    <p>
<?php
// Create an array and push on the names
    // of your closest family and friends
    $somearray = array();
    array_push($somearray, "Garfield");
    array_push($somearray, "Odie");
    array_push($somearray, "John");
// Sort the list
    sort($somearray);
// Randomly select a winner!
    $arraylength = count($somearray);
    $winner = $somearray[rand(0,$arraylength-1)];
// Print the winner's name in ALL CAPS
    print strtoupper($winner);
?>
</p>
</html>

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts