Functions, Part I . Why error?


#1



https://www.codecademy.com/courses/web-beginner-en-7I7Xm/0/7?curriculum_id=5124ef4c78d510dd89003eb8#


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() !


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

	?>
	</p>
</html>


#2

Hey @arcrunner15040,

first of all, put your code (the two lines - rsort() & print) where it should be :stuck_out_tongue: (in the second <p>aragraph inside of the <?php)

Try this first. Can't see atm why you get the error-message, since the syntax is correct imo.


#3

holy sh#t.. thank you


#4

If that was the reason why your code didn't work, then the CodeAcademy-Devs should improve the tool.. :rolling_eyes:

Well, anyway, hope that I could help you with this :slight_smile: