PHP Store Key Value from Associative Array into Simple Array

后端 未结 5 2037
半阙折子戏
半阙折子戏 2021-01-21 07:57

I\'m having trouble wrapping my head around this, any help would be GREAT...

I have an array $stores that is structured like so:

Array
(         


        
5条回答
  •  鱼传尺愫
    2021-01-21 08:08

    If you use php 5.5+, array_column() is quite useful :

    $simple = array_column($yourarray,'id');
    

    http://php.net/array_column

提交回复
热议问题