What will the $array array contain at the end of this script?
function modifyArray (&$array)
{
foreach ($array as &$value)
{
$value = $value + 1;
}
$value = $value + 2;
}
$array = array (1, 2, 3);
modifyArray($array);
What is the name of the function that allows you register a set of functions that implement user-defined session handling?
Which of the following code snippets is correct? (Choose 2)
Consider the following table data and PHP code. What is the outcome?
Table data (table name "users" with primary key "id"):
id name email
------- ----------- -------------------
1 anna alpha@example.com
2 betty beta@example.org
3 clara gamma@example.net
5 sue sigma@example.info
PHP code (assume the PDO connection is correctly established):
$dsn = 'mysql:host=localhost;dbname=exam';
$user = 'username';
$pass = '********';
$pdo = new PDO($dsn, $user, $pass);
try {
$cmd = "INSERT INTO users (id, name, email) VALUES (:id, :name, :email)";
$stmt = $pdo->prepare($cmd);
$stmt->bindValue('id', 1);
$stmt->bindValue('name', 'anna');
$stmt->bindValue('email', 'alpha@example.com');
$stmt->execute();
echo "Success!";
} catch (PDOException $e) {
echo "Failure!";
throw $e;
}
Which class of HTTP status codes is used for server error conditions?
Which of these databases is NOT supported by a PDO driver?
How many elements does the array $pieces contain after the following piece of code has been executed?
$pieces = explode("/", "///");
Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?
Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?
Which SPL class implements fixed-size storage?