3 Months Free Update
3 Months Free Update
3 Months Free Update
You'd like to use the class MyDBConnection that's defined in the MyGreatFrarnework\GreafDatabaseAbstractionLayer namespace, but you want to minimize *as much as possible* the length of the class name you have to type. What would you do?
Given the following DateTime objects, what can you use to compare the two dates and indicate that $date2 is the later of the two dates?
What DOMElement method should be used to check for availability of a non-namespaced attribute?
What is the method used to execute XPath queries in the SimpleXML extension?
What will the following code piece print?
echo strtr('Apples and bananas', 'ae', 'ea')
What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?
You want to allow your users to submit HTML code in a form, which will then be displayed as real code and not affect your site layout. Which function do you apply to the text, when displaying it? (Choose 2)
Consider the following code:
strspn($test, 'aeiou', 1);
The variable $test contains the string "You get certified".
What will the function call return?
You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)
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');
Identify the security vulnerability in the following example:
1
2 mail('feedback@example.org',
3 'Feddback',
4 'Here is my feedback.',
5 "From: {$_COOKIE['email']}");
6 ?>
Which of these protocols are NOT governed by the W3C in their latest versions? (Choose 2)
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?
What XML component does the following XPath query try to match?
//foo[bar/@id=5]
Which one of the following technologies was not built into PHP before version 5?
Which DOMElement property provides a reference to the list of Element's children?
You want to test if a string matches a relatively complex pattern. Which of the following functions can you use? (Choose 2)
What will be the value of $b after running the following code?
$a = array('c', 'b', 'a');
$b = (array)$a;
What function can reverse the order of values in an array without the loss of key information?
What is the output of the following code?
str_pad('PHP', 10, 'P', STR_PAD_BOTH);