Letters Color

by Prabakaran 2011-03-19 17:14:51


function strsplt($thetext,$num)
{
if (!$num)
{
$num=1;
}
$arr=array();
$x=floor(strlen($thetext)/$num);
while ($i<=$x)
{
$y=substr($thetext,$j,$num);
if ($y)
{
array_push($arr,$y);
}
$i++;
$j=$j+$num;
}
return $arr;
}




$str = "Hello Friend";

$arr1 = strsplt($str,1);
$arr2 = strsplt($str, 3);
$colArr = Array('red','blue','green');

//print_r($arr1);
//print_r($arr2);
foreach($arr1 as $val)
{
$num = rand(0,2);
//echo $num.'
';
echo ''.$val.'';

}
?>

Tagged in:

913
like
0
dislike
0
mail
flag

You must LOGIN to add comments