1<?php
2/*
3Variables can store data of different types, and different data types can do different things.
4
5PHP supports the following data types:
6
71) String
82) Integer
93) Float (floating point numbers - also called double)
104) Boolean
115) Array
126) Object
137) NULL
148) Resource
15*/
16
17// PHP String
18$x = "Hello world!";
19echo $x;
20
21//PHP Integer
22$x = 5985;
23var_dump($x);
24
25//PHP Float
26$x = 10.365;
27var_dump($x);
28
29//PHP Boolean
30$x = true;
31$y = false;
32
33//PHP Array
34$cars = array("Volvo","BMW","Toyota");
35var_dump($cars);
36
37//PHP Object
38 class Car {
39 function Car() {
40 $this->model = "VW";
41 }
42 }
43
44 // create an object
45 $herbie = new Car();
46
47 // show object properties
48 echo $herbie->model;
49
50//PHP NULL Value
51$x = "Hello world!";
52$x = null;
53var_dump($x);
54?>
1<?php
2$x = "Hello world!";
3$y = 'Hello world!';
4
5echo $x;
6echo "<br>";
7echo $y;
8?>