這裏是所有外部JS文件的樣本陣列從paypal.com:PHP函數進行重新排序數組
Array
(
[src] => Array
(
[1] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/lib/min/global.js
[2] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/tns/mid.js
[8] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/opinionlab/oo_engine.js
[11] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/iconix.js
[12] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/pageBlockingUnsafeBrowsers.js
[13] => https://www.paypalobjects.com/js/tns/min/bid.js
[15] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/pp_naturalsearch.js
[17] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/site_catalyst/pp_jscode_080706.js
)
[size] => Array
(
[1] => 0.273
[2] => 0.266
[8] => 0.279
[11] => 0.265
[12] => 0.285
[13] => 0.248
[15] => 0.275
[17] => 0.289
)
)
是,有內置的功能,PHP,或自定義的可重新排序這個數組這個(而不大的性能無論是命中):
Array
(
[src] => Array
(
[1] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/lib/min/global.js
[2] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/tns/mid.js
[3] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/opinionlab/oo_engine.js
[4] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/iconix.js
[5] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/pageBlockingUnsafeBrowsers.js
[6] => https://www.paypalobjects.com/js/tns/min/bid.js
[7] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/pp_naturalsearch.js
[8] => https://www.paypalobjects.com/WEBSCR-590-20090814-1/js/site_catalyst/pp_jscode_080706.js
)
[size] => Array
(
[1] => 0.273
[2] => 0.266
[3] => 0.279
[4] => 0.265
[5] => 0.285
[6] => 0.248
[7] => 0.275
[8] => 0.289
)
)
Oups,沒有看到數組嵌套 - 需要編輯... – 2009-08-22 20:45:00