Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- $numbers = array(4, 2, 5, 3); //Indexed array
- echo "The first element is " . $numbers[0];
- echo "<br>The number of elements are " . count($numbers);
- rsort($numbers);
- echo "<br>The elements have been sorted in reverse.";
- print_r($numbers);
- $myName = array(); //Associative array
- $myName["first"] = "Shail";
- $myName["middle"] = "R.";
- $myName["last"] = "Shah";
- echo "<br>My last name is " . $myName["last"];
- $myColleges = array("JC" => "Pace", "Engg" => "TSEC");
- echo "<br>I wasted 2 years at " . $myColleges["JC"];
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement