php - Convert array of keys to associative array -


i have array of data so

[  'one', 'two', 'three' ] 

i need convert so

[   'one' => 'one',   'two' => 'two' ] 

i found out array_flip gives me

[    'one' => 0,    'two' => 0,    'three' => 0 ] 

what can there? clean php way this?

array_combine() way go

$a = array('one', 'two', 'three'); $output = array_combine($a, $a); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -