【问题标题】:Can you rewrite php function without iconv_substr?你可以在没有 iconv_substr 的情况下重写 php 函数吗?
【发布时间】:2011-12-15 17:16:37
【问题描述】:
    for ($count = 0; $count < $strLength; $count++) {
        $this->_queryString[$count] = iconv_substr($inputString, $count, 1, $encoding);
    }

你能通过用另一个函数替换 iconv_substr 来重写上面的 php 函数吗?我需要这样做,因为我的 MAMP 版本似乎是 timeout on iconv_strlen

【问题讨论】:

    标签: php function timeout mamp


    【解决方案1】:

    如果您的 PHP 安装可以使用多字节扩展,请改用 mb_substr

    $this->_queryString[$count] = mb_substr($inputString, $count, 1, $encoding);
    

    【讨论】:

      猜你喜欢
      • 2012-02-08
      • 2020-09-29
      • 1970-01-01
      • 2020-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-22
      相关资源
      最近更新 更多