Jump to content

[SOLVED] Can this codes be make shorter?


coder9

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/115639-solved-can-this-codes-be-make-shorter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.