i have array value like this
Array (
[0] => A1
[1] => A2
)
Array (
[0] => B1
[1] => B2
[2] => B3
)
For exploding
$explodedeductedfinal = explode(",",$CODE);
this is my php code for outputting the data in td
foreach($explodedeductedfinal as $is){
$bankname = trim($is);
if (!empty($bankname)) {
echo "<td class='center'>$bankname</td>";
}else{
echo "<td class='center'>'novalue'</td>";
}
}
Output:
|Column A|Column B|Column C|
A1 A2
B1 B2 B3
Desired Output:
|Column A|Column B|Column C|
A1 A2 novalue
B1 B2 B3
i just want to output when the $bankname is empty it will show no value