substr('6tTPnWsXBBmF5FZ2·mPbpBcZh8D76PrBP~', 16, 1);

E:\Apache\htdocs\site\application\controllers\Welcome.php:16:string '' (length=1)

 

mb_substr('6tTPnWsXBBmF5FZ2·mPbpBcZh8D76PrBP~', 16, 1);

E:\Apache\htdocs\site\application\controllers\Welcome.php:17:string '·' (length=2)

 

substr 是按字节数截取,mb_substr 是按逻辑字段个数截取,才会出现上述情况,可参阅 https://bugs.php.net/bug.php?id=66069

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-21
  • 2021-07-29
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案