Q10 Flashcards

1
Q
Which PHP function returns the number of characters in a string?
 A. length()
 B. strlen()
 C. numofchars()
 D. none of the above
A

B. strlen()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of these is an example of input validation?
A. is it in the correct format?
B. is it safe from hackers?
C. is it free from overflows and other critical errors?
D. all of the above

A

D. all of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
which of these is NOT a code smell?
 A. duplicated code
 B. Small classes
 C. meaningless names
 D. unused code
A

B. Small classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Decision complexity is the type that reflects the complexity of the decisions in your program
A. True
B. False

A

A. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of these statements about Arrays is incorrect?
A. you cannot create an array of numbers
B. if you use the array() command a second time it will overwrite the array variable.
C. if an element is not defined it is ‘unset’ and can be checked by the ‘isset’ function
D. none of the above (tey are all correct)

A

A. you cannot create an array of numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of these is correct about operators?
A. ++$x performs a “post-increment” operation
B. || performs a “or” operation
C. $x++ performs a “pre-increment” operation
D. ! performs “and/or” operation

A

B. || performs a “or” operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of these is correct about Strings and Arrays?
A. we can convert an array into a string with EXPLODE
B. a string is an array of characters
C. we specify what character to use as a connector
D. We can convert a string into an array with IMPLODE

A

B. a string is an array of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

We can sort the data in PHP but we can also sort database records by using the ORDER BY keywords.
A. True
B. False

A

A. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You can have double quotes inside single quoted text
A. True
B. False

A

A. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Echo with double quotes does not do variable substitution
A. True
B. False

A

B. False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The CANCEL keyword will automatically execute a loop
A. True
B. False

A

B. False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of these is correct about forms?
A. processing data submitted from an HTML form on a web page is perhaps the most fundamental task performed by a PHP script
B. the HTML < form > tag’s action attribute is used to nominate the PHP script that will process the form data
C. the < form > tag’s method attribute is used to specify how the data is sent to the script – typically by the POST method
D. all of the above

A

D. all of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
The HTML tag that causes the browser to reload is:
 A. RELOAD
 B. NEW
 C. FORM
 D. None of the above
A

C. FORM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The code “INPUT TYPE=’INPUT’” will always create a button with the word “SUBMIT” in it.
A. True
B. False

A

B. False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

We can use the PHP DATE function to extract and display the current time?
A. True
B. False

A

A. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

To allow the user to select two different radio buttons:
A. we specify different values
B. we specify different types
C. we specify different names
D. it can’t be done: radio buttons only allow ONE selection

A

C. we specify different names

17
Q

If the form specifies an input field “temperature” the action handler code can access the value by referencing the variable “$temperature”.
A. True
B. False

A

B. False

18
Q

To set the value of a cookie named “course ”to the value “221” we would issue the command: $_COOKIE[‘cookie’]=221;
A. True
B. False

A

B. False

19
Q
When setting cookies:
 A. it must be done before the  tag
 B. we can only do it one time in the code
 C. we cannot overwrite the cookie
 D. none of the above
A

A. it must be done before the tag

20
Q

A “timing failure” results when interacting system components are not properly synchronized.
A. True
B. False

A

A. True

21
Q
What do we use to specify inline CSS?
 A. CSS=’ ‘
 B. INLINECSS=’ ‘
 C. ICSS=’ ‘
 D. none of the above
A

D. none of the above

22
Q
What is true about $_POST?
 A. It is an array
 B. It is not a constant
 C. It is a superglobal
 D. all of the above
A

D. all of the above

23
Q

To create selection boxes, we use: type = “select”

A

B. False