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

    • <bdo id='e1jU8'></bdo><ul id='e1jU8'></ul>

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

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

        php计算爆炸后的字符串数

        php count the number of strings after exploded(php计算爆炸后的字符串数)
          1. <legend id='Y3n6u'><style id='Y3n6u'><dir id='Y3n6u'><q id='Y3n6u'></q></dir></style></legend>

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

              <bdo id='Y3n6u'></bdo><ul id='Y3n6u'></ul>
              1. <tfoot id='Y3n6u'></tfoot>

                  <tbody id='Y3n6u'></tbody>

                <i id='Y3n6u'><tr id='Y3n6u'><dt id='Y3n6u'><q id='Y3n6u'><span id='Y3n6u'><b id='Y3n6u'><form id='Y3n6u'><ins id='Y3n6u'></ins><ul id='Y3n6u'></ul><sub id='Y3n6u'></sub></form><legend id='Y3n6u'></legend><bdo id='Y3n6u'><pre id='Y3n6u'><center id='Y3n6u'></center></pre></bdo></b><th id='Y3n6u'></th></span></q></dt></tr></i><div id='Y3n6u'><tfoot id='Y3n6u'></tfoot><dl id='Y3n6u'><fieldset id='Y3n6u'></fieldset></dl></div>
                • 本文介绍了php计算爆炸后的字符串数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这是我的代码

                  <?php
                  
                  $string = 'a|b|c|d|e|f';
                  
                  $tags = explode('|' , $string);
                  
                  
                  foreach($tags as $i =>$key) {
                  $i >0;
                      echo $i.' '.$key .'</br>';
                  
                  }
                  
                  ?>
                  

                  输出是

                  0 a
                  1 b
                  2 c
                  3 d
                  4 e
                  5 f
                  

                  爆炸后我正在尝试计算字符串的数量|(在我的例子中应该是 6)我还需要我的 $i 从 1 开始而不是 0

                  What i'm try to count the number of strings after i exploded | (it should be 6 for my example) also i need my $i to start from 1 not 0

                  有什么想法吗?

                  谢谢.

                  推荐答案

                  <?php
                  
                  $string = 'a|b|c|d|e|f';
                  
                  $tags = explode('|' , $string);
                  
                  
                  foreach($tags as $i =>$key) {
                  
                      echo $i.' '.$key .'</br>';
                  
                  }
                  
                  ?>
                  

                  尝试使用:

                  echo count($tags); // Output of 6
                  

                  数组以 0 的键开始,而不是 1.因此,当使用除计数之外的任何其他内容时,您将不断得到比预期少 1(除非您在计数之前修改数组)

                  Arrays start with a key of 0, not one. So when using anything else apart from count, you will constantly get 1 less than your expected (unless you modify the array prior to counting)

                  这篇关于php计算爆炸后的字符串数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <tfoot id='c6PW7'></tfoot>
                    <tbody id='c6PW7'></tbody>

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

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

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