FUNCTION PHP

FUNCTION PHP

2nd Grade

8 Qs

quiz-placeholder

Similar activities

3.1 Sequence and Debugging

3.1 Sequence and Debugging

2nd Grade

12 Qs

BÀI 8. SẮP XẾP VÀ LỌC DỮ LIỆU

BÀI 8. SẮP XẾP VÀ LỌC DỮ LIỆU

1st - 12th Grade

10 Qs

Cyber Security

Cyber Security

1st - 10th Grade

10 Qs

Google Aptitude Test

Google Aptitude Test

KG - University

10 Qs

BÀI KIỂM TRA GIỮA KÌ 2 LỚP 5

BÀI KIỂM TRA GIỮA KÌ 2 LỚP 5

1st - 10th Grade

10 Qs

ICT 2

ICT 2

1st - 2nd Grade

10 Qs

Paint Program

Paint Program

2nd Grade

10 Qs

FUNCTION PHP

FUNCTION PHP

Assessment

Quiz

Computers

2nd Grade

Practice Problem

Medium

Created by

ANIS (PBU)

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a PHP function?

To store variables

To execute a specific task

To print HTML code

To create classes

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare a function in PHP?

method

func

def

function

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about function names in PHP?

They cannot start with a number

They cannot contain special characters

They are case-insensitive

They must always start with a dollar sign ($)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the keyword "return" do in a PHP function?

It terminates the function

It echoes a message

It sends a value back to the calling code

It generates an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about parameters in PHP functions is true?

Functions cannot accept parameters

Parameters are optional

Parameters are enclosed in curly braces {}

Parameters are placeholders for values passed to the function

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "global" keyword in PHP functions?

To declare a variable as local to the function

To access a variable declared outside of the function

To define a constant

To include another PHP file

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default scope of a PHP function if no scope is specified?

Global

Local

Protected

Private

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?