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代码
<?php if(!empty($_POST['invite'])) { foreach($_POST['invite'] as $check) { echo implode($_POST['invite'], ','); } }
结果是:sky,earth,universesky,earth,universe
这里的结果显示了两次,在宇宙天空重复之后,我只想显示一个结果。
有什么想法吗?
只是echo implode($_POST['invite'], ',');不需要使用循环
echo implode($_POST['invite'], ',');