12m 00s
ID: 178
Fill in the blank with the appropriate PHP function. The _____ function is used to replace the current session id with the new session id, and to keep information of the current session. *Matching is case-insensitive.
regenerate_id_session()
session_id()
regenerate_id()
session_regenerate_id()
ID: 248
Which of the following prepared query strings is used to execute a prepared statement?
ID: 804
What is the output of the following code?
function func($x, $x = 2, $x = 3) { return $x; } echo func(3);
ID: 434
Which of the following is a valid way to pass the $callback parameter expected by array_walk()? (choose three)
ID: 769
class A { protected $a = ''; function x() { echo ++$this->a; } } $a = new A(); $b = $a; $c = new A(); $b->x(); $a->x(); $c->x(); $b = $c; $b->x(); $a->x();
ID: 607
What would go in place of ?????? below to make this script execute without a fatal error?
$a = 1; $b = 0; /* ?????? */ $c = $a / $b;
die();
__halt_compiler();
exit();
quit();
ID: 313
What is output of the following PHP script?
$str = 'foo'; $str .= 'bar'; $num = 0; $num += 25; $num -= 15; echo $str . ' - ' . $num;
ID: 743
What will this code do?
$var = 2; $str = 'aabbccddeeaabbccdd'; echo str_replace('a', 'z', $str, $var);
ID: 400
The following script defines a function called buildUrl(), which is intended to be a crude way of normalizing URLs. What line of code must be inserted into buildUrl() to ensure $url1 and code $url2 are both equal to http://phpriot.com/quiz/?
function buildUrl($domain, $path) { // insert line of code here return $ret; } $domain1 = 'http://phpriot.com/'; $domain2 = 'http://phpriot.com'; $path = '/quiz/'; $url1 = buildUrl($domain1, $path); $url2 = buildUrl($domain2, $path);
$ret = $domain . ltrim($path, '/');
$ret = $domain . trim($path, '/');
$ret = $domain . '/' . ltrim($path, '/');
$ret = rtrim($domain, '/') . '/' . ltrim($path, '/');
ID: 280
What is the maximum limit of the file size that a user can upload according to the code snippet given below?
<form enctype="multipart/form-data" action="index.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="5000" /> <input name="filedata" type="file" /> <input type="submit" value="Send file" /> </form>