How to get the minimum value from array row

前端 未结 6 1739
情话喂你
情话喂你 2021-01-25 01:15

I trying to get the minimum values from the any column contains \"xx\" in the column name.

Below is my code:



        
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 02:18

    Instead of looping again inside just use the min() function.

    $lowest_keys = array();
    
    foreach($array as $item)
    {
         unset( $item[ 'id' ] );
         $lowest_keys[] = min( $item );
    }
    

提交回复
热议问题