This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Functions, Part I Forum

View Course » View Exercise

1266 points
417c3c78895eda1c83a11fea206550df?s=140&d=retro
Submitted by
Landen Lewis
almost 2 years ago

Help on 7/8 Stuck

This is what is says when I do almost the exact thing as the example.

Oops, try again. Your reverse sorted array should have at least 3 elements in it. Make sure to pass a comma as the first argument to join() !


2 votes

permalink

Hey yeah had the same problem too, try having a consistent glue
join(glue, array)
It worked for me

<?php
// Create an array with several elements in it,
// then sort it and print the joined elements to the screen
$thearray = array("html", "css", "javascript", "php");
sort($the
array);
echo join(", ", $the_array);
//your glue is the comma

?>
</p>
<p>
<?php
// Reverse sort your array and print the joined elements to the screen
rsort($the_array);
echo join(", ", $the_array);
?>
</p>

225 points
5a4493eb40e024cbf32574dbe09c50b0?s=140&d=retro
Submitted by
iam_seun
almost 2 years ago