Q10 Flashcards
Which PHP function returns the number of characters in a string? A. length() B. strlen() C. numofchars() D. none of the above
B. strlen()
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
D. all of the above
which of these is NOT a code smell? A. duplicated code B. Small classes C. meaningless names D. unused code
B. Small classes
Decision complexity is the type that reflects the complexity of the decisions in your program
A. True
B. False
A. True
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. you cannot create an array of numbers
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
B. || performs a “or” operation
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
B. a string is an array of characters
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. True
You can have double quotes inside single quoted text
A. True
B. False
A. True
Echo with double quotes does not do variable substitution
A. True
B. False
B. False
The CANCEL keyword will automatically execute a loop
A. True
B. False
B. False
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
D. all of the above
The HTML tag that causes the browser to reload is: A. RELOAD B. NEW C. FORM D. None of the above
C. FORM
The code “INPUT TYPE=’INPUT’” will always create a button with the word “SUBMIT” in it.
A. True
B. False
B. False
We can use the PHP DATE function to extract and display the current time?
A. True
B. False
A. True
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
C. we specify different names
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
B. False
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
B. False
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. it must be done before the tag
A “timing failure” results when interacting system components are not properly synchronized.
A. True
B. False
A. True
What do we use to specify inline CSS? A. CSS=’ ‘ B. INLINECSS=’ ‘ C. ICSS=’ ‘ D. none of the above
D. none of the above
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
D. all of the above
To create selection boxes, we use: type = “select”
B. False