PHP Functions
PHP Functions - Important Points
26. | Which PHP function is used to check if a variable is empty? |
---|
A. empty()
B. is_empty()
C. check_empty()
D. var_empty()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The empty() function is used to check if a variable is empty in PHP.
27. | Which PHP function is used to check if a string contains a specific substring? |
---|
A. strpos()
B. contains()
C. str_contains()
D. find()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strpos() function is used to check if a string contains a specific substring in PHP.
28. | Which PHP function is used to encode a URL? |
---|
A. urlencode()
B. encode_url()
C. url_encode()
D. encode()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The urlencode() function is used to encode a URL in PHP.
29. | Which PHP function is used to sort an array in ascending order? |
---|
A. sort()
B. ascending()
C. arrange()
D. order()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The sort() function is used to sort an array in ascending order in PHP.
30. | Which PHP function is used to get the length of a string? |
---|
A. strlen()
B. string_length()
C. length()
D. str_length()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strlen() function is used to get the length of a string in PHP.