Search Header Logo

PHP Quiz

Authored by Frances Lumanglas

Other

University

Used 1+ times

PHP Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You want to collect user information through a form and display it in the URL. Which method should you use?

Post

Get

Put

Request

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are creating a function to calculate the total cost of items in a shopping cart. Which variable scope should you use to keep track of the total cost within the function only?

Parameter

Static

Local

Static

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are tasked with creating an array to store information about employees, including their names and ages. Which type of array in PHP would be MOST appropriate for this situation?

Associated Array

Multidimensional Array

Sequential Array

Indexed Array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are working on a project where a variable needs to retain its value between function calls. What keyword should you use during variable declaration?

Volatile

Persist

Retain

Static

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You want to loop through an array and perform a specific action for each element. Which loop is MOST suitable for this task?

For-loop

Do-while-loop

While loop

For each loop

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a script, you have a variable named $discount that should be accessible from any part of the code, including functions. What should you use to achieve this?

Local Scope

Static Scope

Global Scope

Parameter Scope

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the CORRECT way of creating a hyperlink in HTML?

<a>www.geeksforgeeks.org <Geeksforgeeks /a>

<a href= “www.geeksforgeeks.org”>Geeksforgeeks</a>

<a link=“www.geeksforgeeks.org” Geeksforgeeks> </a>

<a href=“www.geeksforgeeks.org” Geeksforgeeks /a>

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?