An HTML form contains this form element:
<input type="file" name="myFile" />
When this form is submitted, the following PHP code gets executed:
1
2 move_uploaded_file(
3 $_FILES['myFile']['tmp_name'],
4 'uploads/' . $_FILES['myFile']['name']);
5 ?>
Which of the following actions must be taken before this code may go into production?
(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 will the following code piece print?
echo strtr('Apples and bananas', 'ae', 'ea')
You want to test if a string matches a relatively complex pattern. Which of the following functions can you use? (Choose 2)
What is the output of the following code?
1
2 $a = 'a'; $b = 'b';
3 echo isset($c) ? $a.$b.$c : ($c = 'c').'d';
4 ?>
What will the following code print?
echo addslashes('I am a small "HTML" string, which is
\'invalid\'.');
PDF + Testing Engine |
---|
$66 |
Testing Engine |
---|
$50 |
PDF (Q&A) |
---|
$42 |
Zend Free Exams |
---|
|