Web Development With PHP
Web Development With PHP - Important Points
6. | Which of the following is NOT a valid data type in PHP? |
---|
A. boolean
B. integer
C. float
D. char
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The char data type is not used in PHP; instead, the string data type is used to represent text.
7. | Which PHP function is used to get the length of a string? |
---|
A. strlen()
B. strcount()
C. strlength()
D. strsize()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strlen() function is used to get the length of a string in PHP.
8. | Which PHP function is used to convert a string to all uppercase letters? |
---|
A. strtoupper()
B. upper()
C. toUpper()
D. caseUpper()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strtoupper() function is used to convert a string to all uppercase letters in PHP.
9. | Which of the following is a superglobal variable in PHP? |
---|
A. $_SESSION
B. $_COOKIE
C. $_POST
D. All of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
$_SESSION, $_COOKIE, and $_POST are all examples of superglobal variables in PHP.
10. | Which PHP function is used to include a file in another PHP file? |
---|
A. include()
B. require()
C. import()
D. include_once()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The include() function is used to include a file in another PHP file in PHP.