How can the id attribute of the 2nd baz element from the XML string below be retrieved from the SimpleXML obje
How can the id attribute of the 2nd baz element from the XML string below be retrieved from the
SimpleXML object found inside $xml?
<code>
<?xml version=’1.0′?>
<foo>
<bar>
<baz id=”1″>One</baz>
<baz id=”2″>Two</baz>
</bar>
</foo>
</code>
The constructs for(), foreach(), and each() can all be used to iterate an object if the object
The constructs for(), foreach(), and each() can all be used to iterate an object if the object
How can XML parsing errors be suppressed in the SimpleXML extension?
How can XML parsing errors be suppressed in the SimpleXML extension?
What is the output of the following code?
What is the output of the following code:
<code>
str_replace(array(“Apple”,”Orange”), array(“Orange”,”Apple”), “Oranges are orange and Apples are green”);
</code>
What is the result of the following code?
What is the result of the following code?
<code>
$a = 1;
$b = “1”;
var_dump($a === $b);
</code>
What will be the output of the following code?
What will be the output of the following code?
<code>
$a = array(0, 1, 2 => array(3, 4));
$a[3] = array(4, 5);
echo count($a, 1);
</code>
Identify the security vulnerability in the following example?
Identify the security vulnerability in the following example:
<code>
1 <?php
2 mail(‘feedback@example.org’,
3 ‘Feddback’,
4 ‘Here is my feedback.’,
5 “From: {$_COOKIE[’email’]}”);
6 ?>
</code>
What is the difference between isset() and other is_*() functions (is_alpha(), is_number(), etc.)?
What is the difference between isset() and other is_*() functions (is_alpha(), is_number(), etc.)?
Which functions would you use?
You need to escape special characters to use user input inside a regular expression. Which
functions would you use? (Choose 2)
What will the following function call print?
What will the following function call print?
<code>
printf(‘%010.6f’, 22);
</code>