Assigning string array contents based on an if statement condition
<p>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 <strong>current</strong> 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.</p>

<p>I have been trying to find work arounds for over an hour now, I appreciate any help with this.</p>

<pre><code>$favorites[] = '
        &lt;tr&gt;
          &lt;td&gt;&lt;a href="#"&gt;'.$files_row['name'].'&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a href="#"&gt;&lt;img class="table-button" src="images/smallglobe.png"&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;
            &lt;img src="images/e-mail-icon.PNG"&gt;';
                if(strcmp($_files_row['email'],'none') != 0){
                    $favorites[] = '&lt;div style="display:none;"&gt;&lt;a href="#" &gt;'.$files_row['email'].'&lt;/a&gt;&lt;/div&gt;';
                }
$favorites[]='        
         &lt;/td&gt;
          &lt;td class="table-button-cell"&gt;
            &lt;img class="table-button" src="images/eicon.png"&gt;
            &lt;div class="phonepopup" style="display:none;"&gt;Call: '.$files_row['phone'].'&lt;/div&gt;
          &lt;/td&gt;
          &lt;td class="table-button-cell"&gt; .... etc....
</code></pre>
