使用php中的数字字符串值对关联数组进行排序

时间:2015-03-05 10:19:40

标签: php array-multisort

$array = array(
     0 => array(
        'searchcountvalue' => 2,
        'pastsearchcountvalue' => 0,
        'abstract_count' => 694,
        'past_abstract_count' => 0 
    ),
    1 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 536,
        'abstract_count' => 0,
        'past_abstract_count' => 5667 
    ),
    2 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 12,
        'abstract_count' => 0,
        'past_abstract_count' => 123 
    ),
    3 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 324,
        'abstract_count' => 0,
        'past_abstract_count' => 456 
    ),
    4 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 56,
        'abstract_count' => 0,
        'past_abstract_count' => 345 
    ),
    5 => array(
         'searchcountvalue' => 212,
        'pastsearchcountvalue' => 'null',
        'abstract_count' => 6194,
        'past_abstract_count' => 0 
    ) 
);

我需要这个输出,请帮帮我

对于Asc订单:基于searchcountvalueabstract_countpastsearchcountvaluepast_abstract_count

$array = array(
     0 => array(
         'searchcountvalue' => 2,
        'pastsearchcountvalue' => 0,
        'abstract_count' => 694,
        'past_abstract_count' => 0 
    ),
    1 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 536,
        'abstract_count' => 0,
        'past_abstract_count' => 5667 
    ),
    2 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 12,
        'abstract_count' => 0,
        'past_abstract_count' => 123 
    ),
    3 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 324,
        'abstract_count' => 0,
        'past_abstract_count' => 456 
    ),
    4 => array(
         'searchcountvalue' => "null",
        'pastsearchcountvalue' => 56,
        'abstract_count' => 0,
        'past_abstract_count' => 345 
    ),
    5 => array(
         'searchcountvalue' => 212,
        'pastsearchcountvalue' => 'null',
        'abstract_count' => 6194,
        'past_abstract_count' => 0 
    ) 
);

0 个答案:

没有答案