Which constant must be passed as the second argument to htmlentities() to convert single quotes (') to HTML entities?
Which of the listed changes would you make to the following PHP 4 code in order to make it most compliant with PHP 5? (Choose 2)
class Car {
var $model;
function Car($model) {
$this->model = $model;
} function toString() {
return "I drive a $this->model.";
}}
$c = new Car('Dodge');
echo $c->toString();
?>
You work for a shared hosting provider, and your supervisor asks you to disable user scripts to dynamically load PHP extensions using the dl() function. How can you do this? (Choose 2)
You want to run the following PHP 4 code with PHP 5. In the following example, which access modifier in PHP 5 is equivalent to "var"?
class Test {
var $tester;
}
What is the output of the following code?
echo 0x33, ' monkeys sit on ', 011, ' trees.';
Which of the following statements about PHP is true? (Choose 3)
a) A final class can be derived.
b) A final class may be instantiated.
c) A class with a final function may be derived.
d) Static functions can be final.
e) Properties can be final.
Which of the following statements is correct?
How can you determine if magic_quotes_gpc is enabled? (Choose 2)
What is the output of the following code?
1
2 for ($i = 0; $i < 1.02; $i += 0.17) {
3 $a[$i] = $i;
4 }
5 echo count($a);
6 ?>
Which of the following did not result in an output error in PHP 4 but does in PHP 5?
Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?
You want to present the following formatted number: "999.000.000,00". Which function call is correct?
After executing a SELECT query on a database server,
After performing the following operations:
$a = array('a', 'b', 'c');
$a = array_keys(array_flip($a));
What will be the value of $a?
When PHP is running on a command line, what super-global will contain the command line arguments specified?
You analyze the code of a colleague and see a call to the function quotemeta(). You give the string "Holy $%&[. What's going on?" as a parameter to it. What will it output?
What method can be used to find a tag with the name "foo" via the DOM extension?
What will the following code print?
echo addslashes('I am a small "HTML" string, which is
\'invalid\'.');
Assume that you are using PHP s session management without cookies and want to make sure that session information does not get lost when redirecting the client to another URL. Which of the following functions do you need to achieve that? (Choose 3)
When you need to process the values of columns in a database, you should:
What is the purpose of the open_basedir directive?
How can the line on which HTTP headers were sent inside a script be determined?
The following form is loaded in a recent browser and submitted, with the second list element selected:
In the server-side PHP code to deal with the form data, what is the value of $_POST['list']?
Which function can help prevent cross-site scripting? (Choose 2)
What can prevent PHP from being able to open a file on the hard drive (Choose 3)?
What function can reverse the order of values in an array without the loss of key information?
When a transaction reports no affected rows, it means that: (Choose 2)
What is the ideal method of copying data between two opened files?
What XML component does the following XPath query try to match?
//foo[bar/@id=5]
What does the chown() function do?
An object can be counted with count() and sizeof() if it