PHP Arrays
- 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 can be used to move the pointer to the previous array position?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
prev()
- Which function will return true if a variable is an array or false if it is not?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
A built-in function, is_array(), is available for testing an array. Its prototype follows: boolean is_array(mixed variable).
- PHP’s numerically indexed array begin with position ___________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Like many programming languages, the first element of an array has an index value of 0.
- Which of the following are correct ways of creating an array?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
A variable name should start with $ symbol which is not present in C) and you need not put the square brackets when you use the array() constructor.