-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataTypes.php
68 lines (50 loc) · 1.33 KB
/
dataTypes.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
62
63
64
65
66
67
68
<!DOCTYPE html>
<html>
<body>
<h1>My First PHP page</h1>
<?php
$x = "Hello World";
var_dump($x);
echo "<br>";
$y;
var_dump($y);
echo "<br>";
$x = null;
var_dump($x);
echo "<br>";
class Car {
public $brand;
public $model;
public function __construct($brand, $model) {
$this->brand = $brand;
$this->model = $model;
}
public function message() {
return "My car is a " . $this -> brand . " " . $this -> model . "!<br>";
}
}
$myCar = new Car("Ford", "Mustang");
$myCar1 = new Car("Audi", "A8");
echo $myCar -> message();
echo $myCar1 -> message();
$cars = array("Volvo", "BMW", "Audi");
var_dump($cars);
echo "<br>";
$x = true;
$y = false;
var_dump($x);
echo "<br>";
echo $y . "<br>";
$x = 25.10;
var_dump($x);
echo "<br>";
$x = 2510;
var_dump($x);
echo "<br>";
$x = 'Hello World';
$y = "Hello World";
echo $x . "<br>";
echo $y . "<br>";
?>
</body>
</html>