<tfoot id='xrOSD'></tfoot>

    <small id='xrOSD'></small><noframes id='xrOSD'>

    1. <i id='xrOSD'><tr id='xrOSD'><dt id='xrOSD'><q id='xrOSD'><span id='xrOSD'><b id='xrOSD'><form id='xrOSD'><ins id='xrOSD'></ins><ul id='xrOSD'></ul><sub id='xrOSD'></sub></form><legend id='xrOSD'></legend><bdo id='xrOSD'><pre id='xrOSD'><center id='xrOSD'></center></pre></bdo></b><th id='xrOSD'></th></span></q></dt></tr></i><div id='xrOSD'><tfoot id='xrOSD'></tfoot><dl id='xrOSD'><fieldset id='xrOSD'></fieldset></dl></div>

      • <bdo id='xrOSD'></bdo><ul id='xrOSD'></ul>
      <legend id='xrOSD'><style id='xrOSD'><dir id='xrOSD'><q id='xrOSD'></q></dir></style></legend>

      PHP 计数数组元素

      时间:2023-07-16

      <small id='D2YjM'></small><noframes id='D2YjM'>

          <tbody id='D2YjM'></tbody>

      • <legend id='D2YjM'><style id='D2YjM'><dir id='D2YjM'><q id='D2YjM'></q></dir></style></legend>
              <bdo id='D2YjM'></bdo><ul id='D2YjM'></ul>
            • <i id='D2YjM'><tr id='D2YjM'><dt id='D2YjM'><q id='D2YjM'><span id='D2YjM'><b id='D2YjM'><form id='D2YjM'><ins id='D2YjM'></ins><ul id='D2YjM'></ul><sub id='D2YjM'></sub></form><legend id='D2YjM'></legend><bdo id='D2YjM'><pre id='D2YjM'><center id='D2YjM'></center></pre></bdo></b><th id='D2YjM'></th></span></q></dt></tr></i><div id='D2YjM'><tfoot id='D2YjM'></tfoot><dl id='D2YjM'><fieldset id='D2YjM'></fieldset></dl></div>

                <tfoot id='D2YjM'></tfoot>
                本文介绍了PHP 计数数组元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                有人可以解释为什么这会返回一个数组由 0 个元素组成".:

                hi can someone explain why this would return "An array consists of 0 elements." :

                $arr = array(1,3,5); 
                $count = count($arr); 
                if ($count = 0) { echo "An array is empty."; } else { echo "An array has $count elements."; }
                

                顺便说一下,这是我正在做的一个测验,我不确定为什么这是正确答案?

                By the way, this is one a quiz i'm working through and i'm not sure why this is the correct answer?

                推荐答案

                您在条件语句中将 $count 赋值为 0

                You are assigning $count to 0 in your conditional statement

                代替...

                if ($count = 0)
                

                这样做

                if ($count === 0)
                

                这篇关于PHP 计数数组元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:为什么 count(DOMNode->childNodes) 返回不正确的子节点数?(PHP 和 XML) 下一篇:我需要在 csv 列中获取值的计数(分组)

                相关文章

                1. <small id='kCJGJ'></small><noframes id='kCJGJ'>

                  <legend id='kCJGJ'><style id='kCJGJ'><dir id='kCJGJ'><q id='kCJGJ'></q></dir></style></legend>
                    <bdo id='kCJGJ'></bdo><ul id='kCJGJ'></ul>

                  <tfoot id='kCJGJ'></tfoot>
                2. <i id='kCJGJ'><tr id='kCJGJ'><dt id='kCJGJ'><q id='kCJGJ'><span id='kCJGJ'><b id='kCJGJ'><form id='kCJGJ'><ins id='kCJGJ'></ins><ul id='kCJGJ'></ul><sub id='kCJGJ'></sub></form><legend id='kCJGJ'></legend><bdo id='kCJGJ'><pre id='kCJGJ'><center id='kCJGJ'></center></pre></bdo></b><th id='kCJGJ'></th></span></q></dt></tr></i><div id='kCJGJ'><tfoot id='kCJGJ'></tfoot><dl id='kCJGJ'><fieldset id='kCJGJ'></fieldset></dl></div>