Array functios ll uknown error


#1


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


I'm trying the exercise but i realize that i got an error on the console and when i run the program i just get looped, the only hint is this
Parse error: syntax error, unexpected ',' on line 6


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


#2

In PHP, you need to specify that an array is actually... an array. Like this:

array( );


#3

oh right... i didnt saw that


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.