kusanagi kusanagi - 4 months ago 47
PHP Question

php array copy values to keys

I have this array:

$a = array('b', 'c', 'd');


Is there any simple method to convert the array to :

$a = array('b' => 'b', 'c' => 'c', 'd' => 'd');

Answer
$a = array_combine($a, $a);

http://php.net/array-combine