Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 PHP 中有以下数组:
Array ( [0] => Email [1] => Email [2] => Email [3] => Email [4] => Email [5] => Email [6] => Email [7] => Email )
当我尝试使用 array_flip 翻转它时,它只返回最后一个[Email] => 7,但是,它不显示其余的。我该如何解决
[Email] => 7
在 PHP 中,数组不能有重复的键。PHP 将获取最后一个键并丢弃其余键。
从array_flip()手册:
array_flip()
如果一个值出现多次,则最新的键将用作其值,而其他所有键都将丢失。
我搜索并尝试了几个解决这个问题的方法,但没有一个有效:我有这个 HTML
<div class="detalhes_colunadados"> <div class="detalhescolunadados_blocos"> <h5>Descrição completa</h5> Sala de e