Inside a ternary PHP script, how do I bind a second variable to my string?

Before style = "style =" color: '. $ rx_event_colors. "I want to add the $ ima variable, it's just a variable with an image inside a string. Also, if you think it's just helpful for me to add

 if(!empty($ins_event))
            {
            echo "<tr><td>&nbsp; <a href='". matry::here(array('event_id'=>$ins_event['id'])) . "'" . 
            ( $ins_event['status'] == 2 ? ' style="color: ' . $rx_event_colors . '">Completed Insurance Event' : '>Active Insurance Event') . "</a></td></tr>";     

            }

      

I tried:

? ' $ima, style="style="color: ' . $rx_event_colors . '"
                      style="style="color: ' . $ima, $rx_event_colors . '"
                      style="style="color: ' . ($ima), $rx_event_colors . '"
                      style="style="color: ' . ($ima), ($rx_event_colors) . '"

      

to no avail.

+3


source to share


1 answer


I am assuming that $ ima is a string. To concatenate lines, use "."

So, in the first part of your ternary, if you want to add $ ima , just do this:

' style="color: ' . $ima . $rx_event_colors . '">Completed Insurance Event'

      

, "[$ ima] ". $ima ? , SRC img, STYLE.



UPDATE:

$ima img, style atrribute. :

' style="color: ' . $rx_event_colors . '">' . $ima . 'Completed Insurance Event'

      

+3









All Articles