<tfoot id='kaOFh'></tfoot>

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

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

      1. <i id='kaOFh'><tr id='kaOFh'><dt id='kaOFh'><q id='kaOFh'><span id='kaOFh'><b id='kaOFh'><form id='kaOFh'><ins id='kaOFh'></ins><ul id='kaOFh'></ul><sub id='kaOFh'></sub></form><legend id='kaOFh'></legend><bdo id='kaOFh'><pre id='kaOFh'><center id='kaOFh'></center></pre></bdo></b><th id='kaOFh'></th></span></q></dt></tr></i><div id='kaOFh'><tfoot id='kaOFh'></tfoot><dl id='kaOFh'><fieldset id='kaOFh'></fieldset></dl></div>
        <legend id='kaOFh'><style id='kaOFh'><dir id='kaOFh'><q id='kaOFh'></q></dir></style></legend>
      2. php判断一个变量是否为正整数的三种方法

        时间:2024-06-25
        <legend id='JxiK8'><style id='JxiK8'><dir id='JxiK8'><q id='JxiK8'></q></dir></style></legend>

            <tbody id='JxiK8'></tbody>
          <tfoot id='JxiK8'></tfoot>
        1. <small id='JxiK8'></small><noframes id='JxiK8'>

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

              <i id='JxiK8'><tr id='JxiK8'><dt id='JxiK8'><q id='JxiK8'><span id='JxiK8'><b id='JxiK8'><form id='JxiK8'><ins id='JxiK8'></ins><ul id='JxiK8'></ul><sub id='JxiK8'></sub></form><legend id='JxiK8'></legend><bdo id='JxiK8'><pre id='JxiK8'><center id='JxiK8'></center></pre></bdo></b><th id='JxiK8'></th></span></q></dt></tr></i><div id='JxiK8'><tfoot id='JxiK8'></tfoot><dl id='JxiK8'><fieldset id='JxiK8'></fieldset></dl></div>
                  php判断一个变量是否为正整数,其实方法还是很多的,下面列举了三种方法,希望可以帮大家。

                  方法1:
                  $keyword = '10'; // 0 1.1 1
                  if(preg_match("/^[1-9][0-9]*$/",$keyword)){
                      echo "是正整数!"; 
                      exit();
                  }
                  方法2:
                  if ((floor($jp_total) - $jp_total) !==0){
                      echo "不是正整数";
                  }else{
                      echo "是正整数";
                  }
                  方法3:
                  if(!is_numeric($jp_total)||strpos($jp_total,".")!==false){
                      echo "不是整数";
                  }else{
                      echo "是整数";
                  }
                   
                  上一篇:PHP读取数据库记录转换为JSON的代码 下一篇:没有了

                  相关文章

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

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

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

                      <tfoot id='tTMc1'></tfoot>