200-710 Exam Questions
231 real 200-710 exam questions with expert-verified answers and explanations. Page 5 of 5.
- Question #201Strings & Patterns
You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)
preg_quotequote_metaregex escapinguser input sanitization - Question #202Strings & Patterns
How many elements does the $matches array contain after the following function call is performed? preg_match('/^(\d{1,}(\.[0-z]+))((?:\s+\S)+?)(\s+(?=201[0-9]))/', '21st March 2014...
preg_matchcapture groupsregex$matches array - Question #203Strings & Patterns
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_...
preg_splitPREG_SPLIT_DELIM_CAPTUREcapture groupsstring splitting - Question #204Web Features
Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?
$_SERVERQUERY_STRINGGET parameterssuperglobals - Question #205Strings & Patterns
What is the length of a string returned by: md5(rand(), TRUE)?
md5raw outputstring lengthhashing - Question #206Strings & Patterns
What is the return value of the following code? strpos("me myself and I", "m", 2);
strposoffset parameterstring searchreturn value - Question #207Strings & Patterns
What is the return value of the following code: substr_compare("foobar", "bar", 3);
substr_comparestring comparisonreturn valueoffset - Question #208Security
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...
htmlentitieshtmlspecialcharsXSS preventionoutput encoding - Question #209Strings & Patterns
How many elements does the array $pieces contain after the following piece of code has been executed? $pieces = explode("/", "", "//");
explodedelimiterstring splittingarray count - Question #210Strings & Patterns
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 str...
substrstrrposstring extractionfile path - Question #211Security
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'...
file uploadmove_uploaded_file$_FILESinput sanitization - Question #212Web Features
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?
headers_listHTTP headersresponse headersPHP functions - Question #213State Management
Which options do you have in PHP to set the expiry date of a session?
session expirysession_set_cookie_paramssession_cache_expirephp.ini - Question #214Web Features
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-sid...
checkbox$_POSTform submissionHTML forms - Question #215Web Features
When uploading a file to a PHP script using the HTTP PUT method, where would the file data be found?
HTTP PUTphp://inputfile uploadinput stream - Question #216State Management
Please provide the name of the super-global variable where all the information about cookies is available.
$_COOKIEsuperglobalscookiesPHP basics - Question #217Web Features
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>t...
select element$_POSTform submissionoption value - Question #218Web Features
Which of the following is NOT a requirement for file uploads to work?
file uploadenctypeMAX_FILE_SIZEform requirements - Question #219Web Features
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 r...
image input$_POSTclick coordinatesform submission - Question #220State Management
Which PHP function sets a cookie whose value does not get URL encoded when sending it to the browser?
setrawcookieURL encodingcookiesPHP functions - Question #221State Management
Which PHP function sets a cookie and URL encodes its value when sending it to the browser?
setcookieURL encodingcookiescookie functions - Question #222Web Features
What are two reasons to use POST instead of GET when submitting a form? (Choose two.)
POST vs GETfile uploadCSRFform submission - Question #223PHP Basics
What is a difference between the ?? operator and the ?: operator?
null coalescingternary operatorissetoperators - Question #224Functions
Given the following PHP function: ``` function doSomething(?string $s) { // ... } ``` Which of the following values for the $s parameter do NOT yield a type error when calling the...
nullable typestype hintstype coercionfunction parameters - Question #225PHP Basics
What is the output of the following code? ``` $a=1; $b=2; $c=3; Print (++$a) + (++$b) + (++$c) + ($a++) + (++$b) + ($c++); ```
pre-incrementpost-incrementoperator precedencearithmetic - Question #226Error Handling
True or false: you can catch fatal errors (e.g., parse errors, out of memory errors, compilation errors) in PHP 7 using try/catch.
fatal errorstry/catchPHP 7 errorsError class - Question #227PHP Basics
Are PHP constants case-sensitive?
constantscase sensitivitydefinePHP basics - Question #228Web Features
Which PHP extension allows connecting to the server using a variety of protocols, including HTTP, FTP, LDAP, and more?
libcurlHTTPFTPextensions - Question #229Security
Which of these approaches is recommended to protect a web site against Cross-Site Request Forgery (CSRF)?
CSRFCSRF tokensecurity headersweb security - Question #230Error Handling
Given the following PHP code: ```php <?php class MyException extends Exception { // } try { throw new MyException('something went wrong'); } *** { echo $e->getMessage(); } ?> ``` W...
exception hierarchycatch blockscustom exceptionsunion catch - Question #231Security
Your supervisor wants you to disallow PHP scripts to open remote HTTP and FTP resources using PHP's file functions. Which php.ini setting should you change accordingly?
allow_url_fopenphp.iniremote file accesssecurity configuration