strlen()与mb_strlen()的作用分别是什么

strlen和mb_strlen都是用于截取字符串的,其中strlen只针对单字节编码字符 如果是多字节编码字符 如gbk和utf8 使用strlen会出现乱码 此时可以使用mb_strlen(),专用于处理多字节编码的截取

案例:

strlen()与mb_strlen()的作用分别是什么

strlen()与mb_strlen()的作用分别是什么

posted @ 2017-07-07 13:55 xsatc 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2022-03-05
  • 2022-12-23
  • 2021-05-06
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
相关资源
相似解决方案