Skip to content

Instantly share code, notes, and snippets.

@xavismeh
Created May 25, 2015 10:52
Show Gist options
  • Save xavismeh/1c55faa88c964c2eec13 to your computer and use it in GitHub Desktop.
Save xavismeh/1c55faa88c964c2eec13 to your computer and use it in GitHub Desktop.
<?php
$input = ['a' => 'b', 'c' => 'd'];
$keys = array_keys($input);
$values = array_values($input);
$i = 0;
while (isset($keys[$i], $values[$i])) {
$currentKey = $keys[$i];
$currentValue = $values[$i];
// Do whatever you want
++$i
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment