PHP MySQL FINAL EXAM QUESTIONS
AND ANSWERS
How do you escape into php? - Answer-<?php... ?>
How do you write php Comments? - Answer-// single line
# also a comment
/star
A whole bunch of comments
Star/
What are variables in php? - Answer-Named container for data.
Can be created, changed, deleted at any time in the script.
All variables denoted with leading ($)
A variable is created as soon as you assign a value to it (=)
Case sensitive ($x !=$X)
Names may contain numbers and/or underscores
Must not start with a number
, What are Data Types in php? - Answer-Intergers = whole numbers (6)
Doubles = floating-point numbers (56.23)
Booleans = TRUE (1). FALSE (0)
Strings = words ('PHP 4 President')
Arrays = list of values (4, 8, 15, 16, 23, 42)
Objects = classes, OOP
Resources = database, connections
Null = no value, empty
What is the difference between 'single' and "double" quotes? - Answer-single quotes taken literally,
that's what you get.
double quotes get parsed. Get's the value that's inside the double quote.
What are some Comparison Operators? - Answer-== Equal
!= Not Equal
<> Not Equal
< Less Than
> Greater Than
<= Less than or equal to
>= Greater than or equal to
=== Identical, must be same type
== - Answer-Equal
!= - Answer-Not equal
AND ANSWERS
How do you escape into php? - Answer-<?php... ?>
How do you write php Comments? - Answer-// single line
# also a comment
/star
A whole bunch of comments
Star/
What are variables in php? - Answer-Named container for data.
Can be created, changed, deleted at any time in the script.
All variables denoted with leading ($)
A variable is created as soon as you assign a value to it (=)
Case sensitive ($x !=$X)
Names may contain numbers and/or underscores
Must not start with a number
, What are Data Types in php? - Answer-Intergers = whole numbers (6)
Doubles = floating-point numbers (56.23)
Booleans = TRUE (1). FALSE (0)
Strings = words ('PHP 4 President')
Arrays = list of values (4, 8, 15, 16, 23, 42)
Objects = classes, OOP
Resources = database, connections
Null = no value, empty
What is the difference between 'single' and "double" quotes? - Answer-single quotes taken literally,
that's what you get.
double quotes get parsed. Get's the value that's inside the double quote.
What are some Comparison Operators? - Answer-== Equal
!= Not Equal
<> Not Equal
< Less Than
> Greater Than
<= Less than or equal to
>= Greater than or equal to
=== Identical, must be same type
== - Answer-Equal
!= - Answer-Not equal