• <bdo id='3ThIr'></bdo><ul id='3ThIr'></ul>
    <tfoot id='3ThIr'></tfoot>

      <small id='3ThIr'></small><noframes id='3ThIr'>

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

      <legend id='3ThIr'><style id='3ThIr'><dir id='3ThIr'><q id='3ThIr'></q></dir></style></legend>

      1. 如何通过 foreach 循环修改数组的值?

        时间:2023-09-23
        <tfoot id='APlz5'></tfoot>

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

            <legend id='APlz5'><style id='APlz5'><dir id='APlz5'><q id='APlz5'></q></dir></style></legend>

              <tbody id='APlz5'></tbody>

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

              • <bdo id='APlz5'></bdo><ul id='APlz5'></ul>
                • 本文介绍了如何通过 foreach 循环修改数组的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  所以我有这个 foreach 循环 - 我想根据我对值的修改来修改数组.但是,当我稍后尝试将 $bizaddarray 转换为字符串时,所有 HTML 标记仍然存在.这是我的 foreach 循环 - 如何使条带标签永久化?

                  So I have this foreach loop - and I want to modify the array based on my modification of the values. However when I try to later convert $bizaddarray to a string, all of the HTML tags are still present. Here's my foreach loop - how can I make the strip tags permanent?

                      foreach ($bizaddarray as $value) {
                          strip_tags(ucwords(strtolower($value)));
                      }
                  

                  推荐答案

                  两种方式,可以直接改变当前值共享的内存位置,或者使用源数组访问该值.

                  Two ways, you can alter the memory location shared by the current value directly, or access the value using the source array.

                  // Memory reference
                  foreach ($bizaddarray as &$value) {
                      $value = strip_tags(ucwords(strtolower($value)));
                  }
                  unset($value); # remove the reference
                  

                  // Use source array
                  foreach ($bizaddarray as $key => $value) {
                      $bizaddarray[$key] = strip_tags(ucwords(strtolower($value)));
                  }
                  

                  这篇关于如何通过 foreach 循环修改数组的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:php PDO fetchAll() - 虽然不工作,但 foreach 工作 下一篇:PDO::bindParam 在 foreach 循环中,所有值都设置为相

                  相关文章

                  最新文章

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

                  2. <tfoot id='cBAH0'></tfoot>
                      <bdo id='cBAH0'></bdo><ul id='cBAH0'></ul>

                    <legend id='cBAH0'><style id='cBAH0'><dir id='cBAH0'><q id='cBAH0'></q></dir></style></legend>

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