php 數組組合問題解决方法

WBOY
發布: 2016-06-13 11:37:35
原創
902 人瀏覽過

php 數組組合問題
1. 把一個數組:
[{"0":"1011","post_id":"1011","1":"4","post_parent":"4","2":"hkbc_program_name_image","meta_key":"hkbc_program_name_image","3":"50","meta_value":"50"},{"0":"1011","post_id":"1011","1":"4","post_parent":"4","2":"hkbc_program_name_special","meta_key":"hkbc_program_name_special","3":"462","meta_value":"462"},{"0":"1011","post_id":"1011","1":"4","post_parent":"4","2":"hkbc_program_ad","meta_key":"hkbc_program_ad","3":"581","meta_value":"581"},{"0":"1011","post_id":"1011","1":"4","post_parent":"4","2":"hkbc_program_ad_url","meta_key":"hkbc_program_ad_url","3":"http:\/\/music.baidu.com\/","meta_value":"http:\/\/music.baidu.com\/"},{"0":"1011","post_id":"1011","1":"4","post_parent":"4","2":"hkbc_program_sort","meta_key":"hkbc_program_sort","3":"1.1","meta_value":"1.1"},1.1"},{"0":"1009","post_id":"1009","1":"117","post_parent":"117","2":"hkbc_program_name_image","meta_key":"hkbc_program_name_image","3":"119","meta_value":"119"},{"0":"1009","post_id":"1009","1":"117","post_parent":"117","2":"hkbc_program_name_special","meta_key":"hkbc_program_name_special","3":"463","meta_value":"463"},{"0":"1009","post_id":"1009","1":"117","post_parent":"117","2":"hkbc_program_ad","meta_key":"hkbc_program_ad","3":"111","meta_value":"111"},{"0":"1009","post_id":"1009","1":"117","post_parent":"117","2":"hkbc_program_ad_url","meta_key":"hkbc_program_ad_url","3":"http:\/\/baike.baidu.com\/view\/1433405.htm","meta_value":"http:\/\/baike.baidu.com\/view\/1433405.htm"},{"0":"1009","post_id":"1009","1":"117","post_parent":"117","2":"hkbc_program_sort","meta_key":"hkbc_program_sort","3":"7","meta_value":"7"}]
組合為一個類似:
[{"post_id":"1011","post_parent":"4","hkbc_program_name_image":"50","hkbc_program_name_special":"462","hkbc_program_ad":"581","hkbc_program_ad_url":"http:\/\/music.baidu.com\/","hkbc_program_sort":"1.1"},{"post_id":"1009","post_parent":"117","hkbc_program_name_image":"119","hkbc_program_name_special":"463","hkbc_program_ad":"111","hkbc_program_ad_url":"http:\/\/baike.baidu.com\/view\/1433405.htm","hkbc_program_sort":"7"}]

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板