Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implode array indexes?

Is it possible to implode array's indexes? A function is returning me an array and what I need are the indexes of that array so I want to implode only inexes with comma or any other character for my db work

like image 402
baig772 Avatar asked Sep 18 '12 22:09

baig772


1 Answers

You mean something like this...

implode(',', array_keys($some_arr));

... right? ) Here's documentation for array_keys; in short, when called with a single argument (an array), this function just returns all its keys (as array).

like image 138
raina77ow Avatar answered Oct 18 '22 21:10

raina77ow