When working with the MVC paradigma, the business logic should be implemented in which of the following components?
In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this?
How many elements does the array $pieces contain after the following piece of code has been executed?
$pieces = explode("/", "///");
After running this sort, what will be the value of $b?
$a = array('_!', 'def', 0);
$b = sort($a);
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']?
What is the output of the following script?
1
2 function fibonacci ($x1, $x2)
3 {
4 return $x1 + $x2;
5 }
6
7 $x1 = 0;
8 $x2 = 1;
9
10 for ($i = 0; $i < 10; $i++) {
11 echo fibonacci($x1, $x2) . ',';
12 }
13 ?>
Which of these protocols are NOT governed by the W3C in their latest versions? (Choose 2)
What is the name of the key pointing to the domain name in the array returned by parse_url()?
Which is the most efficient way to determine if a key is present in an array,assuming the array has no NULL values?
You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, you have to ensure that only one database connection should be used at any time. The code also has to open as few new database connections as possible. Which design pattern should you use for this scenario?
Type hinting in PHP allows the identification of the following variable types: (Choose 2)
Which of the following filtering techniques prevents cross-site scripting (XSS) vulnerabilities?
You analyze the code of a collegue and see, it uses the function strcasecmp. You try it out to see what it does and use the following function call:
strcasecmp('hello my dear!', 'Hello my DEAR!');
The function call returns "0". What does that mean?
What is the difference between isset() and other is_*() functions (is_alpha(), is_number(), etc.)?
The following code piece should print "PHP is cool", but unexpectedly, it just prints "cool". How would you correct it?
echo str_replace('PHP is a pain.', 'a pain', 'cool');
What is the name of the method that can be used to provide read access to virtual properties in a class?
What is the output of the following code:
str_replace(array("Apple","Orange"), array("Orange","Apple"), "Oranges are orange and Apples are green");
When a browser requests an image identified by an img tag, it never sends a Cookie header.
Which of the following parts must a XML document have in order to be well-formed?