SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Php Programming Basics
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Predefined constants such as __LINE__ or __FILE__ or __FUNCTION__ or __CLASS__ and __METHOD__
if/elseif/else and switch statements
strip_tags()
Magic Constant
predefined variable
2. To find how many substrings are in a string
substr_count()
$_REQUEST
htmlentities()
GET
3. To sort values of an array without regard to the keys
array()
sort()
index
define()
4. To check if a constant is already declared
error_reporting (E_ALL | E_STRICT)
defined()
general
for ($i = 0; $i < count($array); $i++) {statement(s);}
5. To include files - _______ will give errors and _________ will terminate execution().
array()
include() and require()
loops
double quotes
6. any programing language where the user must support the language the script is written in
if/elseif/else and switch statements
AJAX
shuffle()
client-side programing
7. The three types of loops in PHP are: for - while - ____.
mysql_fetch_object()
html_entity_decode()
+
foreach
8. To determine the amount of elements in an array
error_reporting (0)
crypt()
count()
boolean
9. All variables must begin with _________.
nl2br()
the dollar sign $
client-side programing
empty()
10. Variable names cannot begin with _______
html_entity_decode()
numbers
unset()
server-side programing
11. _____ is a logical operator
Array
XOR
predefined
curly braces; ${$total}
12. The name of the #! used to designate the location of the PHP binary
predefined
Shebang
Array
+
13. a database which is best supported by PHP
mysql
.=
error_reporting (0)
XOR
14. To append elements to an array - this will assign item to the next available index; associative arrays get messy.
predefined
the escape character ''
abs()
$array[] = item
15. Standard Generalized Markup Language
SGML
<<
double quotes
reassign
16. Used to find the amount of words in a string.
predefined variable
isset()
str_word_count()
$var++ and $var
17. To iterate over the values of an array
count()
for ($i = 0; $i < count($array); $i++) {statement(s);}
mysql_fetch_object()
switch
18. The array that stores variables specific to a user's visit
$_SESSION[]
PHP
index
define()
19. TRUE or FALSE
boolean
include() and require()
&
single quotes
20. $_SERVER - $_POST - $_GET - $_COOKIE - $_SESSION - $_ENV; special arrays.
empty()
superglobal
Array
array()
21. Use ______ for search engines or catalogued pages or pages that would be bookmarked.
bin2hex()
is_numeric()
GET
$dbc = mysql_connect(hostname, username, password)
22. To put a dollar sign before a variable like $10 where 10 is the variable's value - you can escape the first dollar sign; $$cost; or you can use __________.
urlencode()
negative numbers
curly braces; ${$total}
shuffle()
23. When used the value can be passed safely through the URL (GET).
urlencode()
str_word_count()
client-side programing
control structure
24. Used to create a substring (referred to as a token) from a larger string
strip_tags()
strtok()
rsort()
predefined
25. Document Type Definitions
DTD
ini_set ('display_errors', 1)
Parse error
array
26. $_POST Data sent using POST found is sent to _______
predefined variable
rand()
strtok()
getrandmax()
27. collection of binary data
$_SESSION[]
string
Array
ini_set ('display_errors', 1)
28. Variable names can begin with __________
preg_match()
Object
$varname[key]
underscores
29. Returns a string with backslashes in front of predefined characters
addslashes()
chr()
bin2hex()
associative array
30. The concatenation operator?
foreach loop
function error_reporting()
ASP
the period; .
31. The seven main SQL (structured query language) functions are alter - create - delete - _______ - insert - select - update
fopen()
^
date()
drop
32. To iterate over the keys and values of an array
reassign
associative array
foreach loop
E_STRICT
33. a line of information that can be stored in a variable or used in a function or statement
string
$array[] = item
$_REQUEST
HTML
34. To counter htmlentities()
$$
curly braces; ${$total}
html_entity_decode()
unset()
35. To sort the values while maintaining the correlation between each value and its key
asort()
addcslashes()
==
strlen()
36. Besides GET and POST ________ can be used to access data but $_POST and $_GET are more precise and therefore preferable.
statement
POST
drop
$_REQUEST
37. The ouput of var_export((bool)"NULL");
true
indexed array
define()
===
38. Hypertext Preprocessor - a server-side programing language used to create webpages
Shebang
drop
PHP
arsort()
39. Active Server Pages
?>
ASP
error_reporting (E_ALL & -E_NOTICE)
addcslashes()
40. To sort values of an array in reversed order
empty()
include() and require()
rsort()
sql
41. Tag to begin a php script
general
>>
Notice
<?php
42. $_SERVER is a ________ variable.
the dollar sign $
predefined
general
+
43. To close a connection between a database
if/elseif/else and switch statements
function
mysql_close($dbc)
define()
44. An array of variables passed with <input /> data
rsort()
mysql_fetch_object()
$_POST[]
integer
45. signed integer
nl2br()
int
server-side programing
index
46. says 'if' this then do this 'else' do this or 'while' this do this
sql
statement
Notice
the period; .
47. Use ______ when there are no variables in the string
error_reporting (E_ALL)
?>
single quotes
statement
48. This will show all error reporting.
array()
SGML
&
error_reporting (E_ALL)
49. To merge arrays
reassign
$varname[key]
array_merge()
Notice
50. Function used to find the absolute value of a number or numeric variable
array_merge()
abs()
?>
empty()