I have following code to print some data,
$html = "<table><tr><th>Email Address</th><th>Event</th><th>Tag</th><th>Time</th></tr>"
.if(count($result->http_response_body->items) > 0) {
foreach ($result->http_response_body->items as $key) {.
"<tr>
<td>". $key->recipient . "</td>
<td>". $key->event . "</td>
<td>" . @$key->tags[0] . "</td>
<td>" . date("r", $key->timestamp) . "</td>
</tr>"
.}
//fetchLogs($result);
}.
"</table>";
echo $html;
When I execute code it gives syntax error, unexpected 'if' condition. How to insert this if condition and other variables inside this table string. Please help.