PHP Practice
Variables
Hello World!Hello World!
5
10
100
Hello World Again
Strings
The quick brown fox jumped over the lazy dog.Lowercase: the quick brown fox jumped over the lazy dog.
Uppercase: THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.
Uppercase first: The quick brown fox jumped over the lazy dog.
Uppercase words: The Quick Brown Fox Jumped Over The Lazy Dog.
Length: 45
Trim: AB C DE
Find: brown fox jumped over the lazy dog.
Replace by string: The super-fast brown fox jumped over the lazy dog.
Repeat: The quick brown fox jumped over the lazy dog.The quick brown fox jumped over the lazy dog.
Make substring: uick brown
Find position: 10
Find character: zy dog.
Numbers
Basic Math: 7Absolute value: 300
Exponential: 256
Square root: 10
Modulo: 6
Random: 1435556400
Random (min, max): 1
+= : 8
++ : 9
2
3
3.14
10.14
1.3333333333333
Round: 3.1
Round: 3.14
Round: 3
Ceiling: 4
Floor: 3
Is 3 integer? 1
Is 3.14 integer?
Is 3 integer?
Is 3.14 integer? 1
Is 3 integer? 1
Is 3.14 integer? 1
Arrays
8dogArray
(
[0] => 6
[1] => fox
[2] => dog
[3] => Array
(
[0] => X
[1] => Y
[2] => Z
)
)
YArray
(
[0] => 6
[1] => fox
[2] => cat
[3] => Array
(
[0] => X
[1] => Y
[2] => Z
)
[4] => mouse
)
Associative Arrays
KevinLarry
Array Functions
Count: 6Max value: 42
Min value: 4
Sort: Array
(
[0] => 4
[1] => 8
[2] => 15
[3] => 16
[4] => 23
[5] => 42
)
Reverse Sort: Array
(
[0] => 42
[1] => 23
[2] => 16
[3] => 15
[4] => 8
[5] => 4
)
Implode: 42 * 23 * 16 * 15 * 8 * 4
Explode:
Array
(
[0] => 42
[1] => 23
[2] => 16
[3] => 15
[4] => 8
[5] => 4
)
15 in array?: 1
19 in array?:
Type Casting/Juggling
String1: stringString2: integer