Source Code:
(back to article)
<?php $person = [ 'name' => 'John Doe', 'age' => 25, 'gender' => 'male', ]; // reset the pointer reset($person); // get the first element echo key($person) . ' => ' . current($person); // outputs 'name => John Doe'
Result:
Report an issue