The php string truncation question [score] page obtains the title field from the database and then displays it on the front-end page. for example, the string is: & quot; php string truncation is the top, top, and top. [score] & quot; now you need to determine if you want to use "... "In place of less than 10 characters, you do not need to intercept the php string. [score question]
The page obtains the title field from the database.
Then, it is displayed on the front-end page.
For example, the string is: "The php string truncation problem is the top, the top, and the top. [score ]"
Now, we need to determine that if more than 10 characters are followed "...",
If it is less than 10 characters, you do not need...
Php string truncation...
------ Solution --------------------
PHP code
$ Title = "php string truncation issues top [score]"; $ len = mb_strlen ($ title, 'utf-8'); echo $ len> 10? Mb_substr ($ title, 'utf-8'). '...': $ title;