Basics Flashcards
1
Q
How to write a variable in php?
A
Dollar sign and then name of the variable.
$name = ‘Scott’;
2
Q
How to write php code in a file?
A
You have to write the php tags
3
Q
What does PHP stand for?
A
Hypertext Preprocessor
4
Q
How to get the length of an array?
A
count($arr);
5
Q
How to get the length of a string?
A
strlen($name);
6
Q
How do you create an array?
A
array(1, 2, 3);
7
Q
How do you log code to the screen? (2 ways)
A
echo
8
Q
How do you print an array?
A
print_r