Home > Backend Development > PHP Tutorial > PHP determines whether the contents of an array have the same value

PHP determines whether the contents of an array have the same value

WBOY
Release: 2016-07-29 09:00:59
Original
2096 people have browsed it

$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>
Copy after login
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template