forked from thecodeholic/php-crash-course-2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
05_arrays.php
61 lines (31 loc) · 1.05 KB
/
05_arrays.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
// Create array
// Print the whole array
// Get element by index
// Set element by index
// Check if array has element at index 2
// Append element
// Print the length of the array
// Add element at the end of the array
// Remove element from the end of the array
// Add element at the beginning of the array
// Remove element from the beginning of the array
// Split the string into an array
// Combine array elements into string
// Check if element exist in the array
// Search element index in the array
// Merge two arrays
// Sorting of array (Reverse order also)
// https://www.php.net/manual/en/ref.array.php
// ============================================
// Associative arrays
// ============================================
// Create an associative array
// Get element by key
// Set element by key
// Null coalescing assignment operator. Since PHP 7.4
// Check if array has specific key
// Print the keys of the array
// Print the values of the array
// Sorting associative arrays by values, by keys
// Two dimensional arrays