Functions construct
The constructs for(), foreach(), and each() can all be used to iterate an object if the object...
A. implements ArrayAccess
B. implements Iterator
C. implements Iterator and ArrayAccess
D. None of the above |
Functions
Which PHP function is used to validate whether the contents of
$_FILES['name']['tmp_name'] have really been uploaded via HTTP, and also save the contents into another folder? |
Answer : move_uploaded_file(), move_uploaded_file
Functions
Which PHP function sets a cookie and URL encodes its value when sending it to the
browser? |
Answer: setcookie, setcookie()
Functions
Which PHP function sets a cookie whose value does not get URL encoded when sending it to the browser? |
setrawcookie, setrawcookie()
Functions
What function can reverse the order of values in an array so that keys are preserved?
A. array_flip()
B. array_reverse()
C. rsort()
D. krsort()
E. array_multisort() |
Functions
PHP's array functions such as array_values() can be used on an object if the object...
A. implements Traversable
B. is an instance of ArrayObject
C. implements ArrayAccess
D. None of the above |
Functions
You need to escape special characters to use user input inside a regular expression.
Which functions would you use? (Choose 2)
A. addslashes()
B. htmlentities()
C. preg_quote()
D. regex_quote()
E. quote_meta() |
Functions
Which function can NOT help prevent cross-site scripting? (Choose 2)
A. addslashes()
B. htmlentities()
C. htmlspecialchars()
D. strip_tags()
E. quotemeta() |
Functions
Which of these error types may be handled by user defined error handler function?
A. E_ERROR
B. E_NOTICE
C. E_PARSE
D. E_WARNING |
Functions
You want to allow your users to submit HTML code in a form, which will then be displayed
as real code and not affect your page layout. Which function do you apply to the text, when
displaying it? (Choose 2)
A. strip_tags()
B. htmlentities()
C. htmltidy()
D. htmlspecialchars()
E. showhtml() |
Functions
You want to parse a URL into its single parts. Which function do you choose?
A. parse_url()
B. url_parse()
C. get_url_parts()
D. geturlparts() |
Functions
Which of the following functions are used to escape data within the context of HTML?
(Choose 2)
A. htmlentities()
B. addslashes()
C. stripslashes()
D. strip_tags()
E. htmlspecialchars() |
Functions
What will the following function call print?
printf('%010.6f', 22);
A. 22
B. 22.00
C. 022.000000
D. 22.000000 |
Functions
Which elements does the array returned by the function pathinfo() contain?
A. root, dir, file
B. dirname, filename, fileextension
C. dirname, basename, extension
D. path, file |
Comparison func and operator
What is the difference between the spaceship operator (<=>) and the strcmp() function?
A. There is no difference in functionality
B. strcmp() returns a Boolean value, the spaceship operator a number
C. strcmp() does a case-intensive comparison, the spaceship operator does not
D. The spaceship operator returns -1, 0 or 1; strcmp() may return any integer |
|
|
Anonimous Functions
Which of the following statements about anonymous functions in PHP are NOT true? (Choose 2)
A. Anonymous functions can be bound to objects
B. Anonymous functions created within object context are always bound to that object
C. Assigning closure to a property of an object binds it to that object
D. Methods bind() and bindTo() of the Closure object provide means to create closures with different binding and scope
E. The binding defines the value of $this and the scope for a closure |
Functions
What function allows resizing of PHP's file write buffer?
A. ob_start()
B. set_write_buffer()
C. stream_set_write_buffer()
D. Change the output_buffering INI setting via ini_set() function |
Functions
Which constant must be passed as the second argument to htmlentities() to convert single
quotes (') to HTML entities?
A. TRUE
B. FALSE
C. ENT_QUOTES
D. ENT_NOQUOTES
E. ENT_COMPAT |
Functions
What is the name of the PHP function used to automatically load non-yet defined classes?
A. autoload()
B. _ _autoload()
C. _ _catch()
D. load()
E. loadClass() |
Functions
Which PHP function retrieves a list of HTTP headers that have been sent as part of the
HTTP response or are ready to be sent?
A. header()
B. headers()
C. headers_list()
D. headers_sent()
E. getresponseheaders() |
Functions
What is the name of the function that allows you register a set of functions that implement
user-defined session handling?
A. session_set_handler()
B. session_set_storage_handler()
C. session_register_handler()
D. session_set_save_handler() |
Functions
What function is best suited for extracting data from a formatted string into an array?
A. fgetcsv
B. sscanf
C. sprintf
D. strtok |
Functions
What function can be used to retrieve an array of current options for a stream context?
A. stream_context_get_params
B. stream_context_get_default
C. stream_context_get_options
D. The 'options' element of the stream_get_meta_data return value |
Functions
Which of the following is NOT a valid function declaration?
A. function x ($x1= array())
B. function x (A $x1)
C. function x (A $x1 = null)
D. function x ($x1 = $x2) |
Functions
Which of the following PHP functions can be used to set the HTTP response code? (chosee 2)
A. header_add()
B. header()
C. http_set_status()
D. http_response_code()
E.http_header_set() |
Functions
Which PHP function is uses to validate wheather the contents of $_FILES['name']['tmp_name'] have relly been uploaded via HTTP? |
Answer : is_uploaded_file(), is_uploaded_file
Functions
How do you allow the caller to submit a variable number of arguments to a function?
A. Using a prototype like function test(... $parameters).
B. Using a prototype like function test() and the function func_get_args() inside the function body.
C. Using a prototype like function test($parameters[]).
D. Using a prototype like function test() and the function get_variable_args() inside the function body.
E. This is not possible in PHP. |
Comparison func and operator
What is the difference between the spaceship operator (<=>) and the strcmp() function?
A. There is no difference in functionality
B. strcmp() returns a Boolean value, the spaceship operator a number
C. strcmp() does a case-intensive comparison, the spaceship operator does not
D. The spaceship operator returns -1, 0 or 1; strcmp() may return any integer |
Functions
Which of the following functions will allow identifying unique values inside an array?
A. array_unique_values
B. array_distinct
C. array_count_values
D. array_intersect
E. array_values |
|