Title: PHP
1PHP
2Arrays
3Lists
4List
Red Sox players Varitek Papelbon Pedroia
5Numbered list
sox array("Varitek", "Papelbon", "Pedroia")
6Numbered list
Array
sox0 "Varitek"sox1 "Papelbon"
7Dictionary list
sox array( "catcher" gt "Varitek",
"closer" gt "Papelbon", second_base" gt
"Pedroia")
8Dictionary list
Associative array
sox"catcher" "Varitek"sox"closer"
"Papelbon"
9Working with arraysBuilt-in functions
count(sox) 3empty(sox)
falsearray_push(sox, "Lowell") "Varitek",
"Papelbon", "Pedroia", "Lowell"array_pop(sox)
"Varitek"
10Working with arraysSorting
sox array("Varitek", "Papelbon", "Pedroia")
sort(sox)
11Working with arraysSorting
sort(sox)
12Working with arraysSorting
asort(sox)
13Functions
f(x) x 1
14Functions
f(x) x 1 f(2)
15Functions
f(x) x 1 f(2) 2 1
16Functions
f(x) x 1 f(2) 2 1 f(2) 3
17Functions
f(x) x 1
18Functions
f(x) x 1 function add_one_to(x) x 1
19Functions
f(x) x 1 function add_one_to(x) x
1 function add_one_to(x) x 1
20Functions
f(x) x 1 function add_one_to(x) x
1 function add_one_to(x) x 1 function
add_one_to(x) x 1
21Functions
f(x) x 1 function add_one_to(x) x
1 function add_one_to(x) x 1 function
add_one_to(x) x 1 function add_one_to(x)
return x 1
22Functions
function add_one_to(x) return x 1
23Functions
add_one_to(x) return x 1 function
add_one_to(2) return 2 1
24Functions
add_one_to(x) return x 1 function
add_one_to(2) return 2 1 function
add_one_to(2) return 3
25Functions
add_one_to(2) 3
26Functions
function name(parameters) statements
27Functions Arrays
sox array("Varitek", "Papelbon",
"Pedroia")array_map("strtoupper", sox)
"VARITEK", "PAPELBON", "PEDROIA"
28Refactoring
Any change to a computer program's code which
improves its readability or simplifies its
structure without changing its results