Why is this code giving an error on the line where I try to access $sector_value['sector_info']['purchase_order'];? But not in the fifth line where I print out the variable $sector_counter?
//SECTOR
$email_body .= <<<SECTOR_DETAILS
<tr>
<td colspan="2">
Sector $sector_counter;
</td>
</tr>
<tr>
<td colspan="2">
Purchase order
</td>
</tr>
<tr>
<td colspan="2">
$sector_value['sector_info']['purchase_order'];
</td>
</tr>
<tr>
<td>
Proof
</td>
</tr>
SECTOR_DETAILS;
This is the error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www2isco/public_html/test/bch/queries/submit_order.php on line 44
Thanks!
Enclose the variable in
{ .. }, it’s in the docs.