Skip to content

Instantly share code, notes, and snippets.

@ranbogmord
Created May 21, 2014 08:48
Show Gist options
  • Save ranbogmord/40e7d1be5d3dd7466a03 to your computer and use it in GitHub Desktop.
Save ranbogmord/40e7d1be5d3dd7466a03 to your computer and use it in GitHub Desktop.
konvert() for Rebecca
$swe = array('Vit', 'Svart', 'Gul', 'Orange', 'Röd', 'Rosa', 'Lila', 'Blå', 'Grön', 'Brun');
function konvert($fargval, $lang){
if (in_array($fargval, $swe)) {
$y=count($swe);
for ($x=0;$x<$y;$x++) {
if($fargval==$swe[$x]) {
echo "<br /><center>" . $fargval . " = " . "$lang[$x]" . "<br /></center>";
}
}
} else {
echo "Felmeddelande här!";
}
}
switch ($typ) {
case 'engelska':
$eng=array('White', 'Black', 'Yellow', 'Orange', 'Red', 'Pink', 'Purple', 'Blue', 'Green', 'Brown');
konvert($fargval, $eng);
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment