coder9 Posted July 19, 2008 Share Posted July 19, 2008 good evening. shorter version of this codes? switch ($link) { case 1: $tmpbakcolor[1]="#C0C0C0"; break; case 2: $tmpbakcolor[2]="#C0C0C0"; break; case 3: $tmpbakcolor[3]="#C0C0C0"; break; case 4: $tmpbakcolor[4]="#C0C0C0"; break; case 5: $tmpbakcolor[5]="#C0C0C0"; break; case 6: $tmpbakcolor[6]="#C0C0C0"; break; case 7: $tmpbakcolor[7]="#C0C0C0"; break; case 8: $tmpbakcolor[8]="#C0C0C0"; break; case 9: $tmpbakcolor[9]="#C0C0C0"; break; case 10: $tmpbakcolor[10]="#C0C0C0"; break; more codes here... case 100: $tmpbakcolor[100]="#C0C0C0"; break; default: echo ""; } loop? thank you. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 19, 2008 Share Posted July 19, 2008 $tmpbakcolor[$link] = "#C0C0C0"; What are you actually trying to do here though....? Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 19, 2008 Author Share Posted July 19, 2008 while($i<=100) { if($i == $link) { $tmpbakcolor[$link]="#C0C0C0"; } $i++; solved! Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 19, 2008 Share Posted July 19, 2008 My code is a lot shorter and faster. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 19, 2008 Author Share Posted July 19, 2008 My code is a lot shorter and faster. Where DarkWater? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 19, 2008 Share Posted July 19, 2008 $tmpbakcolor[$link] = "#C0C0C0"; I meant to post that as response code, THEN ask what you were actually trying to do. >_> 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.