How to implode array indexes?

2020-03-24 05:01发布

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

1条回答
何必那么认真
2楼-- · 2020-03-24 05:31

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).

查看更多
登录 后发表回答