0

i'm unsure if i need to use an array (i'm a newbie to php, the most i've done is make text appear in random color)... anyhow, i want to pass a string to a function that will decrement a color value for each character. here is what i have so far...

<?
function red($str) {  
$red = rand(60, 99) 
                  /** first 2 of the six hex code numbers
                    * the other 4 will be light grey (neutral)
                    * so the string will fade or darken
                    * from the first red value 
                    **/

for (....) // need help here !

echo(....)  // i've got this part figured
}

thanks

2
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by tefflox
0

for ($i = 0; $i< MAXLOOPS; $i++) or you could use a NULL string in an array to indicate the end and get this: while ($string[$i] != "") ($i is the string you're looking at now)

I'm not 100% sure about the code working, but the idea is sound.

0

thanks, i will work with your code. it looks easy the way you have written it, while the tutorials for php arrays seem really obscure.

tho i did realize it's 100% easier to just make an <img src...> file to do what i had in mind.

but i'm learning :-) thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.