PHP Basic Programs for Beginners
PHP Basic Programs for Beginners - Important Points
11. | Which of the following is the correct way to access a specific character in a string in PHP? |
---|
A. $myString[3]
B. $myString{3}
C. Both A and B
D. None of the above
View Answer Discuss Work SpaceAnswer: option c
Explanation:
12. | What is the output of the following PHP code snippet? <?php |
---|
A. 10 is greater than 5
B. 5 is greater than 10
C. 10
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
13. | Which of the following is the correct way to create a multidimensional array in PHP? |
---|
A. $myArray = array("red", "green", "blue");
B. $myArray = array(array(1, 2), array(3, 4));
C. $myArray = array(1, 2, 3 => array("a", "b", "c"));
D. None of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation:
14. | What is the output of the following PHP code snippet? <?php |
---|
A. 5
B. 10
C. 15
D. None of the above
View Answer Discuss Work SpaceAnswer: option c
Explanation:
15. | Which of the following is the correct way to loop through an associative array in PHP? |
---|
A. foreach ($myArray as $value) { ... }
B. foreach ($myArray as $key) { ... }
C. foreach ($myArray as $key => $value) { ... }
D. None of the above
View Answer Discuss Work SpaceAnswer: option c
Explanation: