Is there a way to break apart a word? For instance if I had a variable called $username and its value was "Gerry". I want to be able to take "Gerry" apart and assign a variable for each letter for instance
$letter1=G
$letter2=e
$letter3=r
$letter4=r
$letter5=y
$letter6=""
$letter7=""
$letter8=""
etc
I used this one.
<if $user_name neq "">
<rex "." $user_name>
<$letters=$ret>
<$colors = blue yellow red green>
<Loop $letters $colors>
<if $letters=" "><$letters=blank></if>
<fmt '<img src=/i/letters/%s%s.gif height=30 width=20 border=0 alt=%s>'$colors $letters $user_name>
</loop>
The problem is that once all the colors in the variable $colors are used up then it stops. How can I make it repeat the colors in the same sequence and only stop once all the variables in $letters are used up. And Thank you John for the previous answer.
This is the same idea but slightly more compact.
Side note, you may not want the full user name as alt
text for every image. Either use the full name once for the first image and empty for the rest or just the letter for each. It could be very messy in text otherwise.