menu

PHP Functions

PHP Functions - Important Points


1. Which of the following is a built-in PHP function that returns the length of a string?

A. strlen()

B. str_length()

C. stringlen()

D. strsize()

Discuss Work Space

Answer: option a

Explanation:

The strlen() function returns the length of a string in PHP.

2. Which PHP function is used to create an array?

A. array()

B. create_array()

C. make_array()

D. build_array()

Discuss Work Space

Answer: option a

Explanation:

The array() function is used to create an array in PHP.

3. Which PHP function is used to generate a random number?

A. rand()

B. random()

C. random_num()

D. gen_num()

Discuss Work Space

Answer: option a

Explanation:

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

4. Which PHP function is used to convert a string to uppercase?

A. strtoupper()

B. to_uppercase()

C. upper()

D. convert_upper()

Discuss Work Space

Answer: option a

Explanation:

The strtoupper() function is used to convert a string to uppercase in PHP.

5. Which PHP function is used to get the current date and time?

A. date()

B. time()

C. now()

D. datetime()

Discuss Work Space

Answer: option a

Explanation:

The date() function is used to get the current date and time 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