PHP Functions
PHP Functions - Important Points
| 21. | Which PHP function is used to add elements to the end of an array? |
|---|
A. array_push()
B. add()
C. insert()
D. push()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The array_push() function is used to add elements to the end of an array in PHP.
| 22. | Which PHP function is used to remove duplicate values from an array? |
|---|
A. array_unique()
B. unique()
C. remove_duplicates()
D. deduplicate()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The array_unique() function is used to remove duplicate values from an array in PHP.
| 23. | Which PHP function is used to get the current year? |
|---|
A. date('Y')
B. year()
C. current_year()
D. now('Y')
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The date('Y') function is used to get the current year in PHP.
| 24. | Which PHP function is used to get the MIME type of a file? |
|---|
A. mime_content_type()
B. file_mime_type()
C. get_mime_type()
D. mime_type()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The mime_content_type() function is used to get the MIME type of a file in PHP.
| 25. | Which PHP function is used to replace a portion of a string with another string? |
|---|
A. str_replace()
B. replace()
C. string_replace()
D. swap()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The str_replace() function is used to replace a portion of a string with another string in PHP.