- var_dump: documentation ( source)
- array_slice: documentation ( source)
- current: documentation ( source)
<?php
$array = array(1 => '5ive', 'jim' => 'bob', 4 => 5);
echo 'Pointer is set to: ' . current($array) . "\n";
var_dump(array_slice($array, 0, 1));
echo 'first item: ' . array_slice($array, 0, 1)[0] . "\n";
echo 'Pointer is set to: ' . current($array) . "\n";
var_dump($array);