i have this code which appears serval times throughout the script:
is there anyway I can put this into a function, and then call it everytime i need it?
thanks
Dimava
PHP Code:
if ( $esrb == 1) $esrb = "K-A";
if ( $esrb == 2) $esrb = "E";
if ( $esrb == 3) $esrb = "T"; // pretty much specify the ESRB ratings
if ( $esrb == 4) $esrb = "M";
if ( $esrb == 5) $esrb = "Ao";
if ( $esrb == 6) $esrb = "RP";
if ( $genre == 1) $genre = "Action";
if ( $genre == 2) $genre = "Adventure";
if ( $genre == 3) $genre = "Fighting";
if ( $genre == 4) $genre = "Racing"; // specify the genre
if ( $genre == 5) $genre = "Role Playing";
if ( $genre == 6) $genre = "Simulation";
if ( $genre == 7) $genre = "Sports";
if ( $sv == 1 ) $sv = "<b>S</b>";
if ( $sv == 2 ) $sv = "<b>V</b>"; // specify the Snapshots/ Videos
if ( $sv == 3 ) $sv = "<b>SV</b>";
if ( $color == "#ACDEAC" ) {
$color = "#83CD83"; // set the alternating colors
} elseif ($color = "#83CD83") {
$color = "#ACDEAC";
}
thanks
Dimava
Comment