小编Hai*_*ety的帖子

在字符串中的三个字符后插入破折号的功能?

我在input = text中有一个表单,用户输入的数字如123456我想将其更改为123-456

如何在一定数量的字符后加上破折号?

我尝试了很多功能,但他们都希望改变或重新复制一个角色,我不想改变任何我想插入破折号的东西 - 在字符串中的三个字符之后.

谢谢.

这是从用户那里获取数字的代码我希望将这个数字放入一个函数中插入短划线后插入sting中的三个字符购买用户

<tr>
 <td> <small>RIG CHARGE:</small> </td>
 <td> <input type="text" name="rch" value="<?php echo $objWorksheet->getCellByColumnAndRow(6, 21)->getValue(); ?>"> </td>
</tr>
Run Code Online (Sandbox Code Playgroud)

html php

4
推荐指数
2
解决办法
6125
查看次数

关于 getHighestRow() 的数据不准确

我正在尝试获取包含 Excel 工作簿中数据的最后一行问题出在某些工作表中我获得了正确的数据但在其他工作表中我没有,我试图通过使用getHighestDataRow()而不是更改我的代码,getHighestRow() 但我一直得到相同的结果,所以我将我的 PHPExcel 库从 PHPExcel_1.7.9_doc 更新为 PHPExcel_1.8.0_doc,但结果也相同。有任何想法吗 ?

我想在循环中做一个 if 语句来测试每一行是否为空。

     $lastRowt = $excel2->getActiveSheet()->getHighestDataRow();
      echo" $lastRowt ";
Run Code Online (Sandbox Code Playgroud)

$lastRowt 不断获得 34 但它只有 30 。

    <html>
    <?php

    ini_set('max_execution_time', 300);
    ini_set("memory_limit",-1);

    require_once 'PHPExcel_1.7.9_doc/Classes/PHPExcel/IOFactory.php';
     require_once 'include/adb.php';

    $excel2 = PHPExcel_IOFactory::createReader('Excel2007');
    $excel2 = $excel2->load('try.xlsx');


    $sheetCount = $excel2->getSheetCount();
    for ($x=0; $x<$sheetCount; $x++) {
    echo"now $x <br>";

    $excel2->setActiveSheetIndex($x);

     $objWorksheet = $excel2->getActiveSheet();

     $po  =   $objWorksheet->getCellByColumnAndRow(1, 7)->getValue();
     $in  =   $objWorksheet->getCellByColumnAndRow(6, 7)->getValue();

    $id = date('Y-m-d',PHPExcel_Shared_Date::ExcelToPHP($objWorksheet->getCellByColumnAndRow(6,                 8)->getValue()));


     $esv =   $objWorksheet->getCellByColumnAndRow(4, 19)->getValue();
     $won =   $objWorksheet->getCellByColumnAndRow(0, 21)->getValue();
     $DTH = …
Run Code Online (Sandbox Code Playgroud)

php phpexcel

4
推荐指数
1
解决办法
2373
查看次数

标签 统计

php ×2

html ×1

phpexcel ×1