Language features Flashcards
1
Q
echo
A
outputs strings
2
Q
.
A
concatenation
3
Q
$var
A
php variable declaration requires $ at the front
4
Q
$array
A
arrays are declared by creating a variable, newing up an array, and passing args.
$array = array(“Egg”, “Tomato”, “Bacon”);
5
Q
array_push
A
adds to array
6
Q
unset()
A
removes an item from array
7
Q
strlen()
A
length of a string
8
Q
substr()
A
part of a string
9
Q
strtoupper()
A
uppercase a string
10
Q
strtolower()
A
lowercase a string
11
Q
strpos()
A
gives the first occurence of a character in a string
12
Q
round()
A
rounds to nearest whole number
OPTIONAL: pass number of places to round to
13
Q
join(glue, array)
A
joins an array into a string, with “glue” chars
14
Q
sort()
A
sorts an array
15
Q
rsort()
A
reverse sorts an array