PHP Basic Programs for Beginners
PHP Basic Programs for Beginners - Important Points
1. | What is the output of the following code snippet? <?php |
---|
A. The sum is: 15
B. The sum is: $z
C. The sum is: 5 + 10
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
2. | Which of the following is a valid PHP variable name? |
---|
A. $my_var
B. 1var
C. my-var
D. my var
View Answer Discuss Work SpaceAnswer: option a
Explanation:
3. | What is the output of the following code snippet? <?php |
---|
A. HelloWorld
B. Hello World
C. Hello "World"
D. None of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation:
4. | Which of the following is the correct syntax to create a function in PHP? |
---|
A. function myFunction() {}
B. def myFunction() {}
C. func myFunction() {}
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
5. | What is the output of the following code snippet? <?php |
---|
A. red
B. green
C. blue
D. None of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation: