Given a php.ini setting of:
default_charset = utf-8
What will the following code print in the browser?
Consider the following code. What can be said about the call to file_get_contents?
Which elements does the array returned by the function pathinfo() contain?
Which of the following rules must every correct XML document adhere to? (Choose 2)
When a browser requests an image identified by an img tag, it never sends a Cookie header.
What will the following code print?
echo addslashes('I am a small "HTML" string, which is
\'invalid\'.');
Which constant must be passed as the second argument to htmlentities () to convert single quotes (') to HTML entity?
Given the following two functions, what statement is correct?
function dynamicNew($name) {
return new $name;
}
function reflectionNew($name) {
$r = new ReflectionClass($name);
return $r->newInstanceArgs();
}
How can the constant defined below be accessed from within PHP?
class myClass {
const FOO = 'BAR';
}
When PHP is running on a command line, what super-global will contain the command line arguments specified?
How many elements does the array $pieces contain after the following piece of code has been executed?
$pieces = explode("/", "///");
Consider the following table data and PHP code. What is the outcome?
Table data (table name "users" with primary key "Id"):
PHP code (assume the PDO connection is correctly established):
Which of the following is correct? (Choose 2)
1) A class can extend more than one class.
2) A class can implement more than one class.
3) A class can extend more than one interface.
4) A class can implement more than one interface.
5) An interface can extend more than one interface.
6) An interface can implement more than one interface.
Which DOMElement property provides a reference to the list of Element's children?
What happens if you try to access a property whose name is defined in a parent class as private, and is not declared in the current class?
When working with the MVC paradigma, the business logic should be implemented in which of the following components?
A script residing at http://example.com/phpcert/cookies.php contains the following code:
1 <?php
2 setcookie('name1', 'value1', time() + 60*60*24, '/');
3 setcookie('name1', 'value2');
4 ?>
The web browser is configured to accept all cookies. How many cookies will be set by this script?
You want to extract the pieces of a date string, which looks like this: "2005-11-02". Which of the following pieces of code will property assign $year, $month and $day with their respective values?
Identify the security vulnerability in the following example:
1 <?php
2 echo "Welcome, {$_POST['name']}.";
3 ?>