Skip to content

Instantly share code, notes, and snippets.

@stephenmelrose
Created February 5, 2014 13:15
Show Gist options
  • Save stephenmelrose/8823371 to your computer and use it in GitHub Desktop.
Save stephenmelrose/8823371 to your computer and use it in GitHub Desktop.
array_slice() works on hash tables
<?php
$data = array(
'a' => 1,
'b' => 2,
'c' => 3,
'd' => 4,
'e' => 5
);
var_dump(array_slice($data, 1, 3, true));
/*
Outputs,
array (size=3)
'b' => int 2
'c' => int 3
'd' => int 4
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment