PHP Functions
PHP Functions - Important Points
6. | Which PHP function is used to redirect a user to a different URL? |
---|
A. header()
B. redirect()
C. location()
D. navigate()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The header() function is used to redirect a user to a different URL in PHP.
7. | Which PHP function is used to remove white space from the beginning and end of a string? |
---|
A. trim()
B. remove_whitespace()
C. strip()
D. clean()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The trim() function is used to remove white space from the beginning and end of a string in PHP.
8. | Which PHP function is used to encode a string into HTML entities? |
---|
A. htmlentities()
B. encode_html()
C. html_encode()
D. make_html_entities()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The htmlentities() function is used to encode a string into HTML entities in PHP.
9. | Which PHP function is used to get the length of an array? |
---|
A. count()
B. length()
C. size()
D. array_length()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The count() function is used to get the length of an array in PHP.
10. | Which PHP function is used to round a number to the nearest integer? |
---|
A. round()
B. ceil()
C. floor()
D. int()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The round() function is used to round a number to the nearest integer in PHP.