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
55 lines (32 loc) · 686 Bytes
/
types.php
File metadata and controls
55 lines (32 loc) · 686 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
<?php
#booleans
$true = true; // assign true to $a
$false = false; // assign false to $b
var_dump($true);
var_dump($false);
echo "<br><br>";
#Integers
$int = 10; // decimal number
var_dump($int);
echo "<br><br>";
#Float
$float = 2.8;
var_dump($float);
echo "<br><br>";
#String
$string = "hola";
var_dump($string);
echo "<br><br>";
#array
$array = array("orange", "yellow", "red");
var_dump($array);
echo "<br><br>";
#Object
$object = (object)["city1" => "Barcelona", "city2" => "Madrid", "city3" => "Sevilla"];
echo "I live in: $object->city1 <br>";
var_dump($object);
echo "<br><br>";
#Null
$text = 'Hello darkness my old friend';
$text = null;
?>