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

Thursday, April 25, 2013

Codecademy Sample Solution: Array Functions II



<html>
    <p>
<?php
// Create an array with several elements in it,
// then sort it and print the joined elements to the screen
    $somearray = array(1,3,4,6,5,7,2);
    sort($somearray);
    print join(", ", $somearray);
?>
</p>
<p>
<?php
// Reverse sort your array and print the joined elements to the screen
    rsort($somearray);
    print join(", ", $somearray);
?>
</p>
</html>

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts