<<< Previous question <<< Question ID#0371.md >>> Next question >>>
Consider the following PHP code:
$myArray = [10, 20, 30, 40];
What is the simplest way to return the values 20 and 30 in a new array without modifying $myArray?
- A)
array_slice($myArray, 1, 2);
- B)
array_splice($myArray, 10, 20);
- C)
array_splice($myArray, 1, 2);
- D)
array_splice($myArray, 2, 1);
Answer
Answer: A