Search for question
Question

(a) Here is the definition of a PHP function:

Recall that array $arr can be defined using a statement of the form: ) Give an array $arr such that test ($arr) printsBlue (ii) Give an array $arr such that test ($arr) prints Green Blue Violet ii) Give an array $arr such that test ($arr) prints Green Blue Blue Violet v) Give an array $arr (you need to select a different value of $arr [1] to the one you chose in your answer to a(iii) above) which prints Green Blue Blue Violet (b) Consider the following code fragment in a file index.php

State which variables are certainly set in next_page.php,thanks to the superglobals, and which may be set or not-depending on the behaviour of the user of index.php. You-need to give each variable in the following form:$_SUPERGLOBAL [ `variable'] where SUPERGLOBAL İSthe name of the superglobal where variable has been-set. Justify your answer. Assume that all the variables you mentioned in your answer-to (i) are set in next_page.php. What would a sequence of-echo statements (e.g., as in the code fragment below) for all-these super-global variable(s) print on screen? Give a possible output (variables can be printed in any order).

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6

Fig: 7

Fig: 8

Fig: 9

Fig: 10

Fig: 11

Fig: 12

Fig: 13

Fig: 14

Fig: 15

Fig: 16

Fig: 17