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

显示彩虹字符串

WBOY
Release: 2016-06-07 11:45:56
Original
1733 people have browsed it

用于显示彩虹字符串,支持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元

source:php.cn
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template