How to implode array indexes?

巧了我就是萌 提交于 2019-12-19 08:56:39

问题


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:


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



来源:https://stackoverflow.com/questions/12486021/how-to-implode-array-indexes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!