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
Post a Comment