PHP Arrays
- What will be the output of the following PHP code?
<?php
$Country = array("India", "England", "USA");
echo "I like " . $Country[2] . ", " . $Country[1] . " and " . $Country[0] . ".";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The order of elements defined.
- Which function can be used to move the pointer to the previous array position?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
prev()
- What will be the output of the following PHP code?
<?php
$Employee = array ("Ajit", "Abhay", array ("Prayag", "Imroj"),
"krishana");
echo (count($Employee, 1));
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The array entity holding pear and mango is counted as an item, just as its contents are.
- Which function returns an array consisting of associative key/value pairs?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
array_count_values()
- What will be the output of the following PHP code?
<?php
$Flower = array ("Rose", "Lily ", "Sunflower");
echo (next($Flower));
echo (next($Flower));
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
The next() function returns the array value residing at the position immediately following that of the current array pointer.