PHP Function that returns an array of values of keys -
i have array this...
array ( [0] => array ( [id] => 10651 [userid] => 079eb9f4b9eb573f6aec93ce97ed1e7f ) [1] => array ( [id] => 74315 [userid] => 1283612836 ) [2] => array ( [id] => 74315 [userid] => asydk12893489123 ) )
is there php function returns me array of values of key userid
if make call this...
func($arr_name, $key_name);
regards
no, can make one.
function getfromkey($array, $keyname) { $return = array(); foreach ($array $value) { if (isset($value[$keyname])) $return[] = $value[$keyname]; } return $return; }
Comments
Post a Comment