I have functions which return different predifined values:
function a(){
$value = 'mercedes';
replacevalues($value);
}
function b(){
$value = 'audi';
replacevalues($value);
}
function c(){
$value = 'bmw';
replacevalues($value);
}
Is there a function in PHP which will do something like this:
function replacevalues($value){
switch($value){
case 'mercedes':
echo $value = 'topA'
break;
case 'audi':
echo 'topB'
break
//and so on
}
}
It would be nice if could define an array like this which i only have to iterate through (Or some php function that already exists)
$a = array('mercedes'=>'topA', 'audi' => 'topB');
So that I could expand the array or change the corresponding replacements.
Regards