MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following function is Used to set the array pointer to the value of last key? |
| A. | last() |
| B. | end() |
| C. | next() |
| D. | final() |
| E. | |
| Answer» C. next() | |
| 2. |
<?php&dollar;fruits = array ("apple", "orange", "banana", "guava", "pine-apple", "papaya", "melon");next(&dollar;fruits);next(&dollar;fruits);prev(&dollar;fruits);?>19.Which of the following function is used to get the value of the previous element in an array? |
| A. | last() |
| B. | before() |
| C. | prev() |
| D. | previous() |
| Answer» D. previous() | |
| 3. |
<?php&dollar;a=array(1,2,3,5,6);next(&dollar;a);next(&dollar;a);next(&dollar;a);echo current(&dollar;a);?>18.Predict the output of the following PHP code. |
| A. | guava |
| B. | banana |
| C. | orange |
| D. | pine-apple |
| Answer» D. pine-apple | |
| 4. |
Predict the output of the following code. |
| A. | 2 |
| B. | 3 |
| C. | 4 |
| D. | 5 |
| Answer» E. | |
| 5. |
What is the use of array_values() function? |
| A. | Returns all the values of the respective keys present in the passed array |
| B. | Returns number of elements in the array |
| C. | Can be used to fetch the keys present in the array |
| D. | Returns the values and the frequency of each value in form of an array. |
| Answer» E. | |
| 6. |
What is the use of array_flip() function? |
| A. | Rearranges the array elements in the reverse order |
| B. | Is used to convert the keys to values and values to keys. |
| C. | Can be used to fetch the keys present in the array |
| D. | Returns number of elements in the array |
| Answer» C. Can be used to fetch the keys present in the array | |
| 7. |
What is the use of array_unshift() function? |
| A. | Function is used to print the array in readable format. |
| B. | Adds elements to the beginning of the array and returns the size of array. |
| C. | Function can be used to verify if a variable is an array. Returns TRUE or FALSE |
| D. | Adds elements to the end of the array and returns the size of array. |
| Answer» C. Function can be used to verify if a variable is an array. Returns TRUE or FALSE | |
| 8. |
What is the use of is_array() function? |
| A. | Function is used to print the array in readable format. |
| B. | Adds elements to the beginning of the array and returns the size of array. |
| C. | Function can be used to verify if a variable is an array. Returns TRUE or FALSE |
| D. | Adds elements to the end of the array and returns the size of array. |
| Answer» D. Adds elements to the end of the array and returns the size of array. | |
| 9. |
Key/value pair can be initialized using = operator? |
| A. | True |
| B. | False |
| C. | Depend on program |
| D. | Keys does not exist in array |
| Answer» B. False | |
| 10. |
Keys in array can be non-sequential. |
| A. | True |
| B. | False |
| C. | Depend on program |
| D. | Keys does not exist in array |
| Answer» B. False | |