array_flip(array); 用于反转/交换数组中的键名和对应关联的键值. 示例: $a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow"); $result=array_flip($a1); print_r($result); 输出: Array ( [red] => a [green] => b [blue] => c [yellow] => d ) 文章导航 php 对象(object) 与 数组(array) 的转换 Php+Mysql 保存&变成了& ;