Home >php教程 >php手册 >显示彩虹字符串

显示彩虹字符串

WBOY
WBOYOriginal
2016-06-07 11:45:561728browse

用于显示彩虹字符串,支持UTF8和中文,效果如下:
显示彩虹字符串function color_txt($str){<br>     $len        = mb_strlen($str);<br>     $colorTxt   = '';<br>     for($i=0; $i         $colorTxt .=  '<span>'.mb_substr($str,$i,1,'utf-8').'</span>';<br>     }<br>     return $colorTxt;<br> }<br> function rand_color(){<br>     return '#'.sprintf("%02X",mt_rand(0,255)).sprintf("%02X",mt_rand(0,255)).sprintf("%02X",mt_rand(0,255));<br> }

AD:真正免费,域名+虚机+企业邮箱=0元

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
Previous article:检测PHP版本信息Next article:cookie用法示例