How can a SimpleXML object be converted to a DOM object?
Answer : A
What is the difference between "print" and "echo"?
Answer : B
What is the output of the following code?
function increment ($val)
{
$val = $val + 1;
}
$val = 1;
increment ($val);
echo $val;
See Below Explanation:
Answer : A
Consider the following code. What can be said about the call to file_get_contents?
$getdata = "foo=bar";
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $getdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://example.com/submit.php', false, $context);
Answer : B
Which of the following is NOT true about PHP traits? (Choose 2)
Answer : B, E
Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?
Answer : B
Which of the following does NOT help to protect against session hijacking and fixation attacks?
Answer : C