我需要在 PHP 中对数组进行排序的帮助。我收到这些数组,如下所示:
Array (
[0] => Array (
[0] => Array (
[id] => 1
[username] => STLUserFolks
[event_id] => 7e0a2faa-43c8-4552-b0ec-c4d0fa6c00d1
[event_on] => 2020-06-29 17:39:25.93432
[ent_pix] =>
[\"images/events/STLUserFolks/tammy1.jpeg\",\"images/events/STLUserFolks/tammy2.jpeg\",\"images/events/STLUserFolks/tammy3.jpeg\",\"images/events/STLUserFolks/tammy4.jpeg\",\"images/events/STLUserFolks/tammy5.jpeg\",\"images/events/STLUserFolks/tammy6.jpeg\"]
[amount] => 20
[event_title] => Fun on vacation with friends.
[event_type] => mix
[event_details] => Saw Great and interesting sites today!
)
)
[1] => Array (
[0] => Array (
[id] => 1
[username] => STLUserFolks
[event_id] => debd6476-4f24-4d2c-9973-7c36d256079d
[event_on] => 2020-07-09 05:39:10.588842
[ent_pix] =>
[\"images/events/STLUserFolks/680.JPG\",\"images/events/STLUserFolks/681.JPG\",\"images/events/STLUserFolks/682.JPG\"]
[amount] => 25
[event_title] => Sexy Warm
[event_type] => photos
[event_details] => Feeling the sun on our faces.
)
[1] => Array (
[id] => 1
[user_id] => 2
[username] => STLUserFolks
[member_user] => spiffy_user
[comment_text] => Amazing! you guys are simply amazing!
[created_on] => 2020-07-10 15:04:46.480001
[comment_id] => c803294d-8483-43c9-a76b-4cba56795266
[event_id] => debd6476-4f24-4d2c-9973-7c36d256079d
)
)
[2] => Array (
[0] => Array (
[id] => 1
[username] => STLUserFolks
[event_id] => 3112f8ff-6119-48c4-810c-594585b5dc63
[event_on] => 2020-07-09 07:11:32.840511
[ent_pix] =>
我需要能够循环这些数组以将注释数组([1] 及以上)应用到主数组 [0]。或者我需要 [0] 之后的顺序数组像这样嵌套:
蝴蝶不菲
开满天机