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. To sort the values while maintaining the correlation between each value and its key - in reversed order
abs()
E_STRICT
$dbc = mysql_connect(hostname, username, password)
arsort()
2. To sort by the keys while maintaining the correlation between the key and its value
&
ksort()
arsort()
precedence
3. To iterate over the keys and values of an array
drop
chr()
foreach loop
strlen()
4. To reset an array _______ the array() function to the array
ini_set ('display_errors', 1)
ASP
reassign
$_REQUEST
5. bitwise right shift
>>
negative numbers
nl2br()
reassign
6. Used to check if a variable has a valid numerical value; strings with numerical values pass.
preg_split()
HTML
is_numeric()
echo
7. To reorganise the array randomly
shuffle()
fopen()
error_reporting (E_ALL & -E_NOTICE)
isset()
8. Besides GET and POST ________ can be used to access data but $_POST and $_GET are more precise and therefore preferable.
$_REQUEST
Warning
addcslashes()
is_numeric()
9. Function that contains the highest value that rand() can have randomly
error_reporting (E_ALL & -E_NOTICE)
drop
getrandmax()
rand()
10. $_SERVER is a ________ variable.
is_numeric()
echo
predefined
html_entity_decode()
11. Use ______ when a variable contains any amount of variables; in general.
double quotes
list()
the dollar sign $
Parse error
12. either hasn't yet been set or is assigned NULL value
nl2br()
predefined
null
<?php
13. To assign array element values to individual variables
str_word_count()
arsort()
list()
Notice
14. $_POST and $_GET are ________ variables.
parentheses
nl2br()
predefined
POST
15. This error refers to a variable with no value.
$_POST[]
Notice
?>
server-side programing
16. any programing language where the user must support the language the script is written in
0
client-side programing
$$
mysql_close($dbc)
17. ___________ can be used with substr() to count backward
negative numbers
E_STRICT
predefined
count()
18. The ouput of var_export((bool)"NULL");
$_POST[]
true
predefined variable
variable
19. Used to remove any white space - spaces or newlines or tabs - from the beginning and end of a string - not the middle.
not
trim()
PHP
for ($i = 0; $i < count($array); $i++) {statement(s);}
20. The name of the #! used to designate the location of the PHP binary
Shebang
str_ireplace()
echo
underscores
21. equivalence
defined()
==
numbers
if/elseif/else and switch statements
22. used to round numeric values.
str_word_count()
defined()
numbers
round() Function
23. says 'if' this then do this 'else' do this or 'while' this do this
ini_set ('display_errors', 1)
empty()
statement
numbers
24. Shorthand used to increment and decrement
$var++ and $var
client-side programing
AJAX
mysql_fetch_object()
25. $_SERVER - $_POST - $_GET - $_COOKIE - $_SESSION - $_ENV; special arrays.
<?php
superglobal
empty()
trim()
26. a line of information that can be stored in a variable or used in a function or statement
control structure
empty()
float
string
27. Control structure that continue exit - they perform specific statements for a determined number of iterations.
==
loops
str_word_count()
<?php
28. Leading 0x: 0x13F or 0xA23
E_STRICT
fopen()
WYSIWYG
Hex
29. Variable names can begin with __________
underscores
define()
chop()
AJAX
30. This fatal fatal is caused by a semantic mistake: omission of a semicolon or imbalance of quotations or parentheses or braces.
asort()
Parse error
number_format()
array()
31. The seven main error reporting constants are: E_NOTICE - E_WARNING - E_PARSE - E_ERROR - E_ALL - _____ - E_DEPRECATED
===
preg_split()
Constant
E_STRICT
32. Used to create a substring (referred to as a token) from a larger string
strtok()
crypt()
<<
parentheses
33. A conditional or loop is a ________________.
+= or -= or *= or /=
control structure
!= inequality
.=
34. any programing language where the script is parsed on the server
loops
str_word_count()
server-side programing
Parse error
35. The prefix for a dynamic variable - also known as a variable variable
boolean
$$
for ($i = 0; $i < count($array); $i++) {statement(s);}
unset()
36. To determine the amount of elements in an array
shuffle()
null
count()
$varname[key]
37. Function used to round up to the highest integer
predefined variable
floor()
ceil()
DTD
38. To delete a variable or an element of an array
double quotes
unset()
error_reporting (E_ALL & -E_NOTICE)
asort()
39. To append elements to an array - this will assign item to the next available index; associative arrays get messy.
date()
mysql_fetch_object()
$array[] = item
abs()
40. To remove all HTML and PHP tags.
^
strip_tags()
numbers
arsort()
41. Uses two arguments: constant name and constant definition
float
define()
htmlspecialchars()
SGML
42. collection of binary data
is_numeric()
<<
ceil()
string
43. To check if a constant is already declared
defined()
Parse error
single quotes
POST
44. Hyper Text Markup Language
E_STRICT
int
null
HTML
45. Function used to find the absolute value of a number or numeric variable
string
defined()
str_word_count()
abs()
46. Tag to begin a php script
<?php
reassign
===
boolean
47. Function used to convert new lines in a variable from a form to <br /> tags so that the data can be formatted correctly.
?>
preg_split()
nl2br()
predefined
48. An array whose keys are numbers.
1
$_GET[]
DTD
indexed array
49. Alias of rtrim()
chr()
crypt()
+
chop()
50. searches the subject for matches to a given pattern replaced with the given replacement text
preg_replace()
nl2br()
int
ceil()