menu

PHP Basics

PHP Basics - Important Points


16. Which of the following is used to display the contents of an array in PHP?

A. echo()

B. print()

C. var_dump()

D. all of the above

Discuss Work Space

Answer: option c

Explanation:

The var_dump() function is used to display the contents of an array in PHP.

17. Which of the following is used to get the length of a string in PHP?

A. strlen()

B. strlength()

C. length()

D. strlenof()

Discuss Work Space

Answer: option a

Explanation:

The strlen() function is used to get the length of a string in PHP.

18. Which of the following is used to convert a string to lowercase in PHP?

A. strtolower()

B. tolowercase()

C. lcstring()

D. none of the above

Discuss Work Space

Answer: option a

Explanation:

The strtolower() function is used to convert a string to lowercase in PHP.

19. Which of the following is used to generate a random number in PHP?

A. rand()

B. random()

C. random_number()

D. generate_random_number()

Discuss Work Space

Answer: option a

Explanation:

The rand() function is used to generate a random number in PHP.

20. Which of the following is used to remove whitespace from the beginning and end of a string in PHP?

A. trim()

B. strip()

C. trimstring()

D. none of the above

Discuss Work Space

Answer: option a

Explanation:

The trim() function is used to remove whitespace from the beginning and end of a string 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