1. <tfoot id='sMwN3'></tfoot>

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

      1. <legend id='sMwN3'><style id='sMwN3'><dir id='sMwN3'><q id='sMwN3'></q></dir></style></legend>

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

          <bdo id='sMwN3'></bdo><ul id='sMwN3'></ul>
      2. PHP - foreach 循环中变量前的 &

        时间:2023-09-21

          • <legend id='lpkgr'><style id='lpkgr'><dir id='lpkgr'><q id='lpkgr'></q></dir></style></legend>

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

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

                  <tfoot id='lpkgr'></tfoot>
                    <tbody id='lpkgr'></tbody>
                • 本文介绍了PHP - foreach 循环中变量前的 &的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  可能的重复:
                  参考 - 这个符号在 PHP 中是什么意思? >

                  我需要知道为什么我们在 foreach 循环中的变量之前使用&符号

                  I need to know why we use ampersand before the variable in foreach loop

                  foreach ($wishdets as $wishes => &$wishesarray) {
                      foreach ($wishesarray as $categories => &$categoriesarray) {
                  
                      }
                  }
                  

                  推荐答案

                  这个例子会告诉你区别

                  $array = array(1, 2);
                  foreach ($array as $value) {
                      $value++;
                  }
                  print_r($array); // 1, 2 because we iterated over copy of value
                  
                  foreach ($array as &$value) {
                      $value++;
                  }
                  print_r($array); // 2, 3 because we iterated over references to actual values of array
                  

                  在此处查看 PHP 文档:http://pl.php.net/manual/en/control-structures.foreach.php

                  Check out the PHP docs for this here: http://pl.php.net/manual/en/control-structures.foreach.php

                  这篇关于PHP - foreach 循环中变量前的 &的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:从 Foreach Loop PHP 创建关联数组 下一篇:PHP foreach 只返回键

                  相关文章

                  最新文章

                • <small id='xNM7t'></small><noframes id='xNM7t'>

                • <tfoot id='xNM7t'></tfoot>

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

                  1. <legend id='xNM7t'><style id='xNM7t'><dir id='xNM7t'><q id='xNM7t'></q></dir></style></legend>

                        <bdo id='xNM7t'></bdo><ul id='xNM7t'></ul>