json - MongoDb get only value but not key using php -


i using mongodb , query returns key value following format of var_dump

 <pre>array (size=471)   0 =>      array (size=1)       'sno' => string '162230' (length=6)   1 =>      array (size=1)       'sno' => string '165333' (length=6)   2 =>      array (size=1)       'sno' => string '181312' (length=6)   3 =>      array (size=1)       'sno' => string '181313' (length=6)   4 =>      array (size=1)       'sno' => string '181314' (length=6)   5 =>      array (size=1)       'sno' => string '181315' (length=6)   6 =>      array (size=1)       'sno' => string '181316' (length=6)   7 =>      array (size=1)       'sno' => string '181317' (length=6)   8 =>      array (size=1)       'sno' => string '181318' (length=6)   9 =>      array (size=1)       'sno' => string '181319' (length=6)   10 =>      array (size=1)       'sno' => string '181320' (length=6)</pre> 

i not want key . want array of values without loop.

solved it.

 array_column($arr,"sno") 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -