forked from assembler-institute/php-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.php
More file actions
66 lines (38 loc) · 723 Bytes
/
types.php
File metadata and controls
66 lines (38 loc) · 723 Bytes
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
62
63
64
65
66
<?php
#BOOLEAN
$x = true;
$y = false;
echo "<br><br>";
#INTEGRER - non decimal number between -2,147,483,648 and 2,147,483,647
$x = 5985;
var_dump($x);
echo "<br><br>";
#FLOAT - is a number with a decimal point or a number in exponential form
$x = 10.365;
var_dump($x);
echo "<br><br>";
#STRING
echo 'this is a simple string';
echo "<br><br>";
#ARRAY
$cars = array("Volvo","BMW","Toyota");
var_dump($cars);
$array = [
"foo" => "bar",
"bar" => "foo",
];
echo "<br><br>";
#OBJECT
$fruits = (object)[
"fruit 1" => "mango",
"fruit 2" => "apple",
"fruit 3" => "kiwi",
];
var_dump($fruits);
echo "<br><br>";
#NULL
$x = "Hello world!";
$x = null;
var_dump($x);
echo "<br><br>";
?>