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

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

WBOY
WBOYOriginal
2016-06-13 12:15:503493browse

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

Statement:
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