我在网站上执行了一个关键字搜索,得到了来自mysql的搜索结果。它们按会员等级(0-3)排序。然而,我需要以不同于彼此的方式显示这些等级 - 就像等级3比其他等级更突出。我考虑将行拆分为单独的数组。所以,例如,array0将包含所有排名为0的行,依此类推。然后循环遍历这些数组以显示结果。但是我完全不知道如何做到这一点 - 拆分数组成较小的数组。
(作为参考,我找到了这个问题:splitting a large array into smaller arrays based on the key names 但我不确定那是否是我需要的...也许该问题的某些澄清会对此有所帮助?)
例如,这里是我的数组:
(作为参考,我找到了这个问题:splitting a large array into smaller arrays based on the key names 但我不确定那是否是我需要的...也许该问题的某些澄清会对此有所帮助?)
例如,这里是我的数组:
Array (
[rank] => 3
[organization] => Test Company
[imagecompany] => 1636.gif
[website] => http://www.google.com
[phone] => 344-433-3424
[fax] =>
[address_on_web] => physical
[address] => 2342 Test Ave
[city] => York
[stateprov] => WA
[postalcode] => 00000
[address_mailing] => 2342 Test Ave
[city_mailing] => Seattle
[state_mailing] => WA
[zip_mailing] => 00000
[description] => 'Test test Test test Test test Test test Test
test Test test Test test Test test Test test Test test Test test Test test Test test
Test test Test test'
[customerid] => 1636 )