

IDT105 Recitation
Presentation
•
Computers
•
University
•
Practice Problem
•
Medium
Wency Jorda
Used 1+ times
FREE Resource
3 Slides • 13 Questions
1
2
Multiple Choice
What is the correct way to create an indexed array in PHP?
array = ("apple", "banana");
$array = array("apple", "banana");
$array[] = ("apple", "banana");
create_array("apple", "banana");
3
Multiple Choice
How do you access the second item in the following
array: $fruits = array("apple", "banana", "cherry");?
fruits[1];
$fruits[1];
$fruits[2];
$fruits{1};
4
Open Ended
Create a multidimensional array representing 3 users.
Each user must have a name, a nested array of 3 purchased products, and a nested associative array for their shipping address (city, province, zip)
5
6
Multiple Choice
Which of the following statements correctly sorts an associative array $a in descending order by value?
asort($a);
ksort($a);
arsort($a);
rsort($a);
7
Multiple Choice
What does array_keys(array("a" => 0, "b" => null, "c" => false), null, true) return?
["c"]
[]
["a", "b", "c"]
["b"]
8
Multiple Choice
Which method is more secure for transmitting sensitive form data?
REQUEST
GET
POST
C
9
Multiple Choice
What would $_REQUEST["name"] return if both GET and POST forms submitted a "name" field?
An array with both values
Depends on PHP configuration
Always the GET value
Always the POST value
10
Open Ended
Create a login form that uses htmlspecialchars() to prevent XSS and isset() to prevent undefined index errors.
11
12
Multiple Choice
Which function is best suited for validating an email address format?
preg_match()
isset()
explode()
strpos()
13
Multiple Choice
Which is false about $_COOKIE?
It is set with setcookie()
It can persist after the browser closes
It is stored on the client machine
It is encrypted by default
14
Multiple Choice
What is the output of this code?
$_GET["x"] = "<script>alert('x')</script>";
echo htmlspecialchars($_GET["x"]);
Escapes HTML and executes script
Prevents script execution
Displays alert popup
Echoes raw HTML
15
Open Ended
Explain the difference between $_POST, $_GET, and $_REQUEST. Provide examples when each is preferable.
16
Multiple Choice
What does this return?
$email = "user@example.com";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) echo "Valid";
else echo "Invalid";
Error
Nothing
Valid
Invalid
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
11 questions
Module 11 Part I: Early Medieval, Carolingian and Ottonian Art
Presentation
•
University
12 questions
Prepositions
Presentation
•
3rd Grade
10 questions
FRUIT AND VEGETABLES
Presentation
•
University
11 questions
Countable and uncountable nouns
Presentation
•
University
13 questions
Good Shape
Presentation
•
12th Grade - University
12 questions
Something to eat
Presentation
•
University
10 questions
PBO JAVA
Presentation
•
12th Grade
10 questions
MS champ
Presentation
•
University
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade