12m 00s
ID: 569
Consider the following script:
$string = "<b>I like 'PHP' & I think it is \"cool\"</b>"; var_dump(htmlentities($string, ENT_QUOTES)); var_dump(htmlspecialchars($string));
In this script, do the two var_dump() calls produce the same string? Why or Why Not?
ID: 386
What is the output of the following PHP script?
$arr = array_flip(['a' => 1, 'b' => 2, 'c' => 3]); foreach (array_values($arr) as $k => $v) { echo $k; }
ID: 723
What happens when the script below is executed ?
$a = array(1,2,3); $b = array(7,8,9); $counta = count($a); $countb = sizeof($b); if ($counta===$countb) { echo "They are equal and have the same type"; } else { echo "They are not equal or they are not of the same type"; }
ID: 632
What is the output of the following script?
class ClassOne { protected $a = 10; public function changeValue($b) { $this->a = $b; } } class ClassTwo extends ClassOne { protected $b = 10; public function changeValue($b) { $this->b = 10; parent::changeValue($this->a + $this->b); } public function displayValues() { print "a: {$this->a}, b: {$this->b}\n"; } } $obj = new ClassTwo(); $obj->changeValue(20); $obj->changeValue(10); $obj->displayValues();
ID: 162
Which of the following functions can be used as a countermeasure to a Shell Injection attack? Each correct answer represents a complete solution. Choose all that apply.
escapeshellarg()
regenerateid()
mysqli_real_escape_string()
escapeshellcmd()
ID: 8
What will be the output of the following PHP script:
function modifyArray(&$array) { foreach ($array as &$value) { $value = $value + 2; } $value = $value + 3; } $array = array(1, 2, 3); modifyArray($array); print_r($array);
ID: 459
Which of the following statements are true when applied to a Registry pattern? (choose two)
ID: 352
$number = 25; if ($number <= 25) { echo "lte"; } else if ($number == 25) { echo "e"; } else if ($number >= 25) { echo "gte"; } else { echo "o"; }
Enter the exact script output
ID: 217
$string1 = "ab"; $string2 = "cd"; $string1 = $string1 . $string2; $string3 = "abc"; $string1 .= $string3; echo $string1;
What will be the output of the above PHP script?
ID: 657
Which function is best suited for removing markup tags from a string?