SilentQ-noob- Posted July 17, 2007 Share Posted July 17, 2007 On one page, named words.php, the person is asked to enter four words and hit submit- this then posts it to a new page. On this form - words_process.php, the words are separated and ordered one on top of the other- what I also want to do, but cant, is give each word a different colour. $worddivide = explode(" ", $_POST['words']); echo $worddivide[0]."<br />"; echo $worddivide[1]."<br />"; echo $worddivide[2]."<br />"; echo $worddivide[3]."<br />"; make first word blue, second red for example. Any help would be greatly appreciated. THANKS! -NOOB- Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 17, 2007 Share Posted July 17, 2007 hmm try <style type="text/css"> <!-- .style1 {color: #000099} .style2 {color: #FF0000} --> </style> <? $worddivide = explode(" ", $_POST['words']); for ($ctr=0;$ctr<=count($worddivide);$ctr++) { echo "<span class='style".$ctr."'>".$worddivide[$ctr]."<br /></span>"; } ?> hope that helps ;D Quote Link to comment Share on other sites More sharing options...
SilentQ-noob- Posted July 17, 2007 Author Share Posted July 17, 2007 Made my day- Thanks bro Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.