Is there a way to use if/else code multiple times for different variables? This is just a example because I don't know how to search for it or if it even exist? Can someone point me in the right direction?
function value(){
if ($value > 999 && $value <= 999999) {
$value = number_format($value / 1000,1) . 'K';
} elseif ($value > 999999) {
$value = number_format($value / 1000000,1) . 'mln';
} else {
$value;
}
}
value($variable1);
value($variable2);
value($variable3);