我有 2 个数组:
Array
(
[field_bathrooms] => Bathrooms
[field_bedrooms] => Bedrooms
[field_king_beds] => King Beds
[field_kitchen] => Kitchen
[field_queen_beds] => Queen Beds
[field_sleeps_max] => Sleeps
[field_sofa_beds] => Sofa Beds
[field_sqft] => Square Footage
[field_twin_beds] => Twin Beds
)
Array
(
[0] => Bathrooms
[1] => Square Footage
[2] => King Beds
[3] => Sofa Beds
[4] => Sleeps
[5] => Twin Beds
[6] => Queen Beds
[7] => Kitchen
[8] => Bedrooms
)
我想通过第二个数组的键对第一个数组进行排序,所以最终结果是这样的数组:
Array(
[field_bathrooms] => Bathrooms
[field_sqft] => Square Footage
[field_king_beds] => King Beds
[field_sofa_beds] => Sofa Beds
[field_sleeps_max] => Sleeps
[field_twin_beds] => Twin Beds
[field_queen_beds] => Queen Beds
[field_kitchen] => Kitchen
[field_bedrooms] => Bedrooms
)
我必须承认我对 PHP 和 MySQL 还比较陌生。希望你们中的某个人能让我重回正轨。