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