$err is the content of the radio button group of the post. The customer requires that all radio button groups cannot select the first one, which is 1, which is the excellent below.
<code><span>//比较是不是所有的二比学生都投的优秀</span><span>$shabi</span>=<span>false</span>; <span>foreach</span>(<span>$err</span><span>as</span><span>$err_k</span> => <span>$err_v</span>){ <span>if</span>(<span>$err_v</span>==<span>'1'</span>){ <span>$shabi</span>=<span>true</span>; }<span>else</span>{ <span>$shabi</span>=<span>false</span>; <span>break</span>; } } <span>if</span>(<span>$shabi</span>==<span>true</span>){ <span>echo</span><span>"不能都是优秀哦"</span>; }</code>
The above introduces how PHP determines whether the contents of an array have the same value, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.