substr() return incorrect number of characters
问题 substr() is returning 28 characters instead of 25. $nature_goods is the input field, where user can enter string containing special characters. Code $nature_goods = "Nature quantityyy of goods is nice 120pcs 1*X23X24898"; echo strlen($nature_goods); echo "<br>"; echo substr($nature_goods, 0,25); echo "<br>"; echo strlen(substr($nature_goods, 0,25)); echo "<br>"; echo substr($nature_goods, 25,50); echo "<br>"; echo strlen(substr($nature_goods, 25,50)); echo "<br>"; Output 53 Nature quantityyy