Hi,
I am new to PHP as I am sure you will see.
I have an array that when displayed on the page is perfect. I then need to send the same information to my email script which is in table format. Everything works fine in the email apart from the array.
This is the code that takes the 5 element array and removes the empty elements and echo's the remaining elements:
$var_selected=array($var1,$var2,$var3,$var4,$var5);
$cleaned = array_filter($var_selected, 'strlen');
foreach($cleaned as $show_vars)
{
echo ($show_vars . "<br/>");
}
As I say this works fine but in the email it does not work:
<?php
<table width='590' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='103' bgcolor='#00AFF0'>td>
<td width='320' bgcolor='#00AFF0'><h2>test Email</h2></td>
<td width='167' bgcolor='#00AFF0'></td>
</tr>
</table>
<table width='600' border='0' cellspacing='0' cellpadding='7'>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr bgcolor='#FFFFC0'>
<td width='40'></td>
<td width='250'>Data 1:</td>
<td width='310'> $data1 </td>
</tr>
<tr bgcolor='#CFF2FF'>
<td></td>
<td>Data 2:</td>
<td>$data2</td>
</tr>
<tr bgcolor='#CBFFCB'>
<td></td>
<td>Data 3:</td>
<td>$data3</td>
</tr>
<tr bgcolor='#CFF2FF'>
<td></td>
<td>Data 4:</td>
<td>$data4</td>
</tr>
<tr bgcolor='#CBFFCB'>
<td></td>
<td>Data 5:</td>
<td>$data5</td>
</tr>
<tr bgcolor='#CFF2FF'>
<td></td>
<td>Data 6:</td>
<td>$data6</td>
</tr>
<tr bgcolor='#CBFFCB'>
<td></td>
<td>Data 7:</td>
<td>$data7</td>
</tr>
<tr bgcolor='#CFF2FF'>
<td></td>
<td>Data 8:</td>
<td>$data8</td>
</tr>
<tr bgcolor='#CBFFCB'>
<td></td>
<td>Data 9:</td>
<td>
$var_selected=array($var1,$var2,$var3,$var4,$var5)
$cleaned = array_filter($var_selected, 'strlen')
foreach($cleaned as $show_vars)
{
echo $show_vars . \"<br/>\"
}
</td>
</tr>
<tr bgcolor='#FFC0C0'>
<td></td>
<td>Data 10:</td>
<td>$data10</td>
</tr>
<tr bgcolor='#FFFFFF'>
<td></td>
<td></td>
<td></td>
</tr>
<tr bgcolor='#FFE9D9'>
<td></td>
<td></td>
</tr>
<tr bgcolor='#E2DEDE'>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
; ?>
Any help would be gratefully accepted as this is driving me up the wall.


