Variables

First look at using variables:

I have been working at Concordia since 1992! We're in Canada.

Numeric variables:

int(7)
10
int(26)
int(83)
float(3.7)

Boolean variables:

bool(true)
bool(false)
bool(true)
bool(false)

Array variables:

Car makes:

Array ( [0] => Audi [1] => BMW [2] => Mercedes )

Car makes: Element one

Audi

Shopping Basket:

Array ( [a] => bread [b] => milk [c] => eggs )
array(3) { ["a"]=> string(5) "bread" ["b"]=> string(4) "milk" ["c"]=> string(4) "eggs" }

shoppingBasket1 == shoppingBasket2

bool(true)

shoppingBasket1 === shoppingBasket2

bool(false)

Basket 3

Array ( [d] => yogurt [e] => orange [f] => apple )

shoppingBasket1<> shoppingBasket3

bool(true)

shoppingBasket1 + shoppingBasket3

Array ( [a] => bread [b] => milk [c] => eggs [d] => yogurt [e] => orange [f] => apple )

Object variables:

object(car)#1 (2) { ["make"]=> string(4) "Ford" ["status":"car":private]=> string(3) "off" }
Ford
object(car)#1 (2) { ["make"]=> string(4) "Ford" ["status":"car":private]=> string(2) "on" }
on

Resource variables:

resource(3) of type (stream)
Reading just a few characters from the file: test1
Reading the entire file: test2 test3 test4 test5