尝试回显html,并收到此错误:解析错误:语法错误,意外T_CONSTANT_ENCAPSED_STRING,期待','或';' 在

I need to echo html (which also contains a variable) and I keep getting Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<h1 align = "center"><strong>Section:</strong></h1>.''.'<h1align="center"><strong>$line1   ['section_id']</strong></h1>';} 

Basically, I need it to read Section: (and then whatever is retrived for Section ID, all on one line). What is the best way to go about outputting html is a situation lke this?

Your code is a trainwreck. Try this:

while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo '<h1 align = "center"><strong>Section:</strong></h1><h1 align="center"><strong>' . $line1['section_id'] . '</strong></h1>';
}
while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<h1 align = "center"><strong>Section:</strong></h1><h1align="center">    <strong>' . $line1 . ' ' .  ['section_id'] .'</strong></h1>';} 

there you go