Skip to content

Instantly share code, notes, and snippets.

@varemenos
Created March 17, 2012 16:13
Show Gist options
  • Save varemenos/2061584 to your computer and use it in GitHub Desktop.
Save varemenos/2061584 to your computer and use it in GitHub Desktop.
PHP - Array Keys to Values
<?php
$a = array(
'x' => 'X',
'xx' => 'XX',
'xxx' => 'XXX'
);
var_dump(array_keys($a));
// RESULTS
/*
array
0 => string 'x' (length=1)
1 => string 'xx' (length=2)
2 => string 'xxx' (length=3)
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment