I need to store different table markup code in a php array, as a string. Some of the code that needs to be stored in an array needs to be tested using an if-statement. Before I knew I needed some of the code needs to be tested in such a way, everything was working flawlessly, but now that I know that the string stored is based on an 'if-statement' I am not sure how to code it. Because I need to end the markup for the current slot in order to insert the php conditional statement. As a result, I am unable to continue storing data in the 'current' slot, which is what I need.
I have been trying to find work arounds for over an hour now, I appreciate any help with this.
$favorites[] = '
<tr>
<td><a href="#">'.$files_row['name'].'</a></td>
<td><a href="#"><img class="table-button" src="images/smallglobe.png"></a></td>
<td>
<img src="images/e-mail-icon.PNG">';
if(strcmp($_files_row['email'],'none') != 0){
$favorites[] = '<div style="display:none;"><a href="#" >'.$files_row['email'].'</a></div>';
}
$favorites[]='
</td>
<td class="table-button-cell">
<img class="table-button" src="images/eicon.png">
<div class="phonepopup" style="display:none;">Call: '.$files_row['phone'].'</div>
</td>
<td class="table-button-cell"> .... etc....