PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/2.1/Testing/Tests/Arrays/array_slice.php

#
PHP | 11 lines | 10 code | 1 blank | 0 comment | 0 complexity | bf4b5ec178ae030d89a86555b0318e45 MD5 | raw file
Possible License(s): CPL-1.0, GPL-2.0, CC-BY-SA-3.0, MPL-2.0-no-copyleft-exception, Apache-2.0
  1. [expect php]
  2. [file]
  3. <?
  4. $input = array(1 => "a", "X" => "b", 2 => "c", "Y" => "d", 3 => "e");
  5. print_r(array_slice($input, 2));
  6. print_r(array_slice($input, -2, 1));
  7. print_r(array_slice($input, 0, 3));
  8. print_r(array_slice($input, 2, -1));
  9. print_r(array_slice($input, 2, -1, true));
  10. ?>