在字符串中的每个第12个字符后添加单词break标记

Rus*_*ces 0 html php string

$my_string = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
Run Code Online (Sandbox Code Playgroud)

预期结果 :

"Lorem Ipsum <br/> is simply<br/> dummy text<br/>of the printing<br/> and typesetting<br/> industry."
Run Code Online (Sandbox Code Playgroud)

标签应该在每第12个字符后添加,而不是像这样:

There are ma<br/>ny variations
Run Code Online (Sandbox Code Playgroud)

Sha*_*ngh 8

尝试使用wordwrap.我认为它应该可以解决你的问题.