200-550 Exam Questions
221 real 200-550 exam questions with expert-verified answers and explanations. Page 4 of 5.
- Question #169
What will be the output of the following code? $a = array(0, 1, 2 => array(3, 4)); $a[3] = array(4, 5); echo count($a, 1);
- Question #170
Given the following array: $a = array(28, 15, 77, 43); Which function will remove the value 28 from $a?
- Question #171
The constructs for(), foreach(), and each() can all be used to iterate an object if the object...
- Question #172
Which parts of the text are matched in the following regular expression? $text = <<<EOT The big bang bonged under the bung. EOT; preg_match_all('@b.n?g@', $text, $matches);
- Question #173
What will the following code piece print? echo strtr('Apples and bananas', 'ae', 'ea')
- Question #174
You want to parse a URL into its single parts. Which function do you choose?
- Question #175
Which elements does the array returned by the function pathinfo() contain?
- Question #176
What will the following function call print? printf('%010.6f', 22);
- Question #177
What is the output of the following code? echo 0x33, ' monkeys sit on ', 011, ' trees.';
- Question #178
You want to access the 3rd character of a string, contained in the variable $test. Which of the following possibilites work? (Choose 2)
- Question #179
Which sentence describes the following regular expression match? preg_match('/^\d+(?:\.[0-9]+)?$/', $test);
- Question #180
You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)
- Question #181
How many elements does the $matches array contain after the following function call is performed? preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=201[0-9])/', '21st March 2014', $matc...
- Question #182
How many elements does the array $matches from the following code contain? $str = "The cat sat on the roof of their house."; $matches = preg_split("/(the)/i", $str, -1, PREG_SPLIT_...
- Question #183
Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?
- Question #184
What is the length of a string returned by: md5(rand(), TRUE);
- Question #185
What is the return value of the following code? strpos("me myself and I", "m", 2)
- Question #186
What is the return value of the following code: substr_compare("foobar", "bar", 3);
- Question #187
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...
- Question #188
How many elements does the array $pieces contain after the following piece of code has been executed? $pieces = explode("/", "///");
- Question #189
Which string will be returned by the following function call? $test = '/etc/conf.d/wireless'; substr($test, strrpos($test, '/')); // note that strrpos() is being called, and not st...
- Question #190
An HTML form contains this form element: <input type="file" name="myFile" /> When this form is submitted, the following PHP code gets executed: move_uploaded_file( $_FILES['myFile'...
- Question #191
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?
- Question #192
Which options do you have in PHP to set the expiry date of a session?
- Question #193
The following form is loaded in a browser and submitted, with the checkbox activated: <form method="post"> <input type="checkbox" name="accept" /> </form> In the server-side PHP co...
- Question #194
When uploading a file to a PHP script using the HTTP PUT method, where would the file data be found?
- Question #196
The following form is loaded in a recent browser and submitted, with the second select option selected: <form method="post"> <select name="list"> <option>one</option> <option>two</...
- Question #197
Which of the following is NOT a requirement for file uploads to work?
- Question #198
An HTML form contains this form element: <input type="image" name="myImage" src="image.png" /> The user clicks on the image to submit the form. How can you now access the relative...
- Question #201
What is the output of the following code? echo '1' . (print '2') + 3;
- Question #202
What is the output of the following code? $a = 3; switch ($a) { case 1: echo 'one'; break; case 2: echo 'two'; break; default: echo 'four'; break; case 3: echo 'three'; break; }
- Question #203
What is "instanceof" an example of?
- Question #204
Which of the following may be used in conjunction with CASE inside a SWITCH statement?
- Question #206
Which of the following are valid identifiers? (Choose 3)
- Question #207
What super-global should be used to access information about uploaded files via a POST request?
- Question #208
What is the difference between "print" and "echo"?
- Question #209
What is the output of the following code? echo "1" + 2 * "0x02";
- Question #210
Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?
- Question #211
Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following c...
- Question #212
Consider the following table data and PHP code. What is the outcome? Table data (table name "users" with primary key "id"): id name email ------- ----------- ------------------- 1...
- Question #213
Consider the following table data and PHP code. What is the outcome? Table data (table name "users" with primary key "id"): id name email ------- ----------- ------------------- 1...
- Question #214
Consider the following table data and PHP code. What is a possible outcome? Table data (table name "users" with primary key "id"): id name email ------- ----------- ---------------...
- Question #215
Consider the following table data and PHP code, and assume that the database supports transactions. What is the outcome? Table data (table name "users" with primary key "id"): id n...
- Question #216
Given a PHP value, which sample shows how to convert the value to JSON?
- Question #217
Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?
- Question #218
Which of the following PHP values may NOT be encoded to a JavaScript literal using PHP's ext/json capabilities?
- Question #219
Which of the following will NOT instantiate a DateTime object with the current timestamp?
- Question #220
Given a DateTime object that is set to the first second of the year 2014, which of the following samples will correctly return a date in the format '2014-01-01 00:00:01'?
- Question #221
Given the following DateTime objects, what can you use to compare the two dates and indicate that $date2 is the later of the two dates? $date1 = new DateTime('2014-02-03'); $date2...
- Question #222
Given the following DateTime object, which sample will NOT alter the date to the value '2014-02- 15'? $date = new DateTime('2014-03-15');