substr() return incorrect number of characters

前端 未结 2 1493
清歌不尽
清歌不尽 2021-01-26 11:28

substr() is returning 28 characters instead of 25.

$nature_goods is the input field, where user can enter string containing special characters.

2条回答
  •  逝去的感伤
    2021-01-26 11:39

    In substr() function third parameter is used to set the length not to set the position. For more details please visit

    http://php.net/manual/en/function.substr.php

提交回复
热议问题