Hello,
I couldn’t find any idea how to do it
$quattro can have one or two or three or four or five values
i want to add + after each value, but it won’t be at the beginning and the end
Sample.
4IF+MDU+RF,
8IF+MDU
RF
12IF+MDU+RF
16IF+RF
MDU+RF
Priority order
The first should be “xIF”, the next should be “MDU”, the end should be “RF”
$ifnumber = 0;
$mdu = "";
$rf = "";
$quatro[] = 4; // there will be variables with different names
$quatro[] = 4; // there will be variables with different names
//$quatro[] = 4; // there will be variables with different names
$quatro[] = 4; // there will be variables with different names
//$quatro[] = "MDU";
$quatro[] = "RF";
foreach($quatro AS $value){
if(is_numeric($value)){
$ifnumber += $value;
}elseif($value == "MDU"){
$mdu = "MDU";
}elseif($value == "RF"){
$rf = "RF";
}
}
if(is_numeric($ifnumber)){
$ifnumber = $ifnumber."IF";
}
Thank you