I want to be able to display links based on cell values.
So if I have this table:
<tr style="background-color:#576c11;">
<td style="font-size:18px; color:#f0cb01;">'.$data["keyword"].'</td>
<td style="font-size:18px;color:#f0cb01;">'.$data["block"].'</td>
<td style="font-size:18px;color:#f0cb01;">'.$data["phone"].'</td>
<td style="font-size:18px;color:#f0cb01;">'.$data["Reason"].'</td>
And I want to display a 5th cell to display a link based on the reason cell, how can I accomplish that?
So if reason cell is 65 then the next cell would be <a href="65.html">Link</a>
for the most part they will all be the same but some cells will differ.
The way your input is formatted, this is part of some larger string, beginning somewhere with a single quote you have not copied, and ending somewhere else with another single quote you have not copied. Correct behaviour depends very much on what the context enclosing that string is.
If you’re assembling a string in a variable, you could simply do a case distinction using
ifto decide what string to append next, based in the reason. If this is a string passed to some function, perhaps you should assemble it in a variable, the way I just described, and then pass that result to the function. If there is some very good reason this has to be a single expression, you could use the conditional operator: