Home > Backend Development > PHP Tutorial > 怎么把长字符串按10个字符自动换行

怎么把长字符串按10个字符自动换行

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:15:50
Original
3634 people have browsed it

如何把长字符串按10个字符自动换行?
如何把长字符串按10个字符自动换行?
------解决思路----------------------
$str = "2165168161531321321afdsfdsgtrg34577876mjgmhgndsvcds23432";
for ($i = 0; $i     echo ($i != 0 && $i % 10 == 0) ? "
" : '';
    echo $str[$i];    
}

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template