php解析和whitespacing错误


php parsing and whitespacing error

1
echo"<OPTION value=$data2['product_id']>$data2['product_id']</OPTION>";

这给了我以下错误:

PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING

你能帮我一下吗?如何修复此错误?


1
echo"<OPTION value=".$data2['product_id'].">".$data2['product_id']."</OPTION>";


要么

1
echo"<OPTION value=$data2[product_id]>$data2[product_id]</OPTION>";

1
echo"<OPTION value={$data2['product_id']}>{$data2['product_id']}</OPTION>";