forked from assembler-institute/php-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrays.php
More file actions
34 lines (32 loc) · 1.04 KB
/
arrays.php
File metadata and controls
34 lines (32 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
<?php
$manga = array("Op, Zatch bell, Konosuba");
print_r($manga);
echo "<br><br>";
$numbers = array (5, 6, 4.2, 2.14);
print_r($numbers);
echo "<br><br>";
$gaming = array (
array("Ps5",16,19),
array("NSwtich",17,12),
array("XboxScorpion",4,1),
array("Wii",20,12)
);
echo $gaming[0][0].": In stock: ".$gaming[0][1].", sold: ".$gaming[0][2].".<br>";
echo $gaming[1][0].": In stock: ".$gaming[1][1].", sold: ".$gaming[1][2].".<br>";
echo $gaming[2][0].": In stock: ".$gaming[2][1].", sold: ".$gaming[2][2].".<br>";
echo $gaming[3][0].": In stock: ".$gaming[3][1].", sold: ".$gaming[3][2].".<br>";
echo "<br><br>";
$candys = array("sugar","gumis","trince", "palet");
echo count($candys);
echo "<br><br>";
$k = array('green', 'red', 'yellow');
$l = array('hulk', 'sanji', 'sukuna');
$mix = array_combine($k, $l);
print_r($mix);
echo "<br><br>";
$letters = array('a', 'b', 'c','d', 'e', 'f');
echo end($letters);
echo "<br><br>";
$fruitsM = array("banana", "avocado", "apple");
array_push($fruitsM, "blueberry", "strawberry");
print_r($fruitsM);