-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorderAraay.php
More file actions
47 lines (36 loc) · 1.04 KB
/
orderAraay.php
File metadata and controls
47 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Codecademy;
$first_array = ["hello", 42, "world", 3.14, "PHP"];
echo count($first_array);
echo "<br>";
$with_function = array("PHP", "popcorn", 555.55);
$with_short = ["PHP", "popcorn", 555.55];
$message = ["Oh hey", " You're doing great", " Keep up the good work!"];
echo "<br>";
$favorite_nums = [7, 201, 33, 88, 91];
echo "<br>";
echo implode("!", $message);
print_r($favorite_nums);
echo "<br>";
$round_one = ["X", "X", "first winner"];
echo "<br>";
$round_two = ["second winner", "X", "X", "X"];
echo "<br>";
$round_three = ["X", "X", "X", "X", "third winner"];
echo "<br>";
$winners = [$round_one[2], $round_two[0], $round_three[4]];
print_r($winners);$change_me = [3, 6, 9];
$change_me[] = "new string";
$change_me[] = 100;
$change_me[1] = "tadpole";
print_r($change_me);
$stack = ["wild success", "failure", "struggle"];
array_push($stack, "blocker", "impediment");
echo "After pushing elements: ";
print_r($stack);
while (count($stack) > 1) {
array_pop($stack);
}
echo "After popping elements: ";
print_r($stack)
?>