PHP Functions
PHP Functions - Important Points
16. | Which PHP function is used to convert a string to an array? |
---|
A. explode()
B. string_to_array()
C. str_array()
D. make_array()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The explode() function is used to convert a string to an array in PHP.
17. | Which PHP function is used to get the value of a specific cookie? |
---|
A. $_COOKIE[]
B. get_cookie()
C. cookie_value()
D. fetch_cookie()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The $_COOKIE[] superglobal is used to get the value of a specific cookie in PHP.
18. | Which PHP function is used to get the current timestamp? |
---|
A. time()
B. current_time()
C. timestamp()
D. now()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The time() function is used to get the current timestamp in PHP.
19. | Which PHP function is used to generate a unique ID? |
---|
A. uniqid()
B. unique_id()
C. gen_id()
D. create_id()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The uniqid() function is used to generate a unique ID in PHP.
20. | Which PHP function is used to calculate the absolute value of a number? |
---|
A. abs()
B. absolute()
C. val()
D. value()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The abs() function is used to calculate the absolute value of a number in PHP.