• BOOKMARK

  • ADD TO FAVORITES

  • REFERENCES


  • MARC

    Mailing list ARChives
    - Search by -
     Subjects
     Authors
     Bodies





    FOLDOC

    Computing Dictionary




  • Text Link Ads






PHP Random FONT Color Function

PHP Tutorials.

PHP Random FONT Color Function

New postby Cat on Sat Dec 28, 2013 3:50 pm

Code: [Select all] [Expand/Collapse] [Download] (Untitled)
<?php
error_reporting(0);
function rcolor() {
srand((double)microtime()*10000000);
$rand = (rand(30,170));
return sprintf("%02X","$rand");
}

function rand_color($string) {
$array = explode(" ",$string);
$j = count($array);
for ($i=0;$i<$j;$i++) {
$return .= '<font color="#'.rcolor().rcolor().rcolor().'">'.$array[$i].' </font>'; }
return $return;
}
?>

<html>
<body bgcolor="#FFFFFF">
<h3>
<?php echo rand_color("This is an example of my rand_color() function on a long string"); ?>
</h3>
</body>
</html>




Anyone who wishes to make additions or changes to this tutorial email them to webmaster@linuxguruz.com
User avatar
Cat
 
Posts: 15
Joined: Thu Dec 26, 2013 7:21 pm

Return to PHP Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests

  • MORE RESOURCE


  • Linux

    The Distributions





    Linux

    The Software





    Linux

    The News



  • MARKETING






  • Toll Free
cron