Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 575 Bytes

0371.md

File metadata and controls

36 lines (28 loc) · 575 Bytes

Consider the following PHP code:

$myArray = [10203040];

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