menu

PHP Basics

PHP Basics - Important Points


26. Which of the following is used to add an element to the beginning of an array in PHP?

A. array_push()

B. array_pop()

C. array_shift()

D. array_unshift()

Discuss Work Space

Answer: option d

Explanation:

The array_unshift() function is used to add an element to the beginning of an array in PHP.

27. Which of the following is used to remove the first element from an array in PHP?

A. array_push()

B. array_pop()

C. array_shift()

D. array_unshift()

Discuss Work Space

Answer: option c

Explanation:

The array_shift() function is used to remove the first element from an array in PHP.

28. Which of the following is used to check if a variable is an array in PHP?

A. is_array()

B. array()

C. isArray()

D. none of the above

Discuss Work Space

Answer: option a

Explanation:

The is_array() function is used to check if a variable is an array in PHP.

29. Which of the following is used to check if a variable is set and not NULL in PHP?

A. isset()

B. empty()

C. defined()

D. none of the above

Discuss Work Space

Answer: option a

Explanation:

The isset() function is used to check if a variable is set and not NULL in PHP.

30. Which of the following is used to check if a variable is empty in PHP?

A. isset()

B. empty()

C. defined()

D. none of the above

Discuss Work Space

Answer: option b

Explanation:

The empty() function is used to check if a variable is empty in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now