谁能帮我找出这段代码中的错误。当我尝试运行它时,它说有一个意外的';' 在第 10 行,但我不确定这会在哪里。谢谢`
$lines = array (
0=>'Once upon a time',
1=>'There lived a small green frog that lived',
2=>'on a lilypad in a pond. ',
3=>'One day a princess came along and kissed it.'
);
$max = count($lines) ;
$out = null ;
while ($i = 0; $i<$max; $i++) {
$opentag = '' ;
$closetag = '' ;
if ($i = 0) {
$opentag = '<h1>' ;
$closetag = '</h1>' ;
}
if ($i = 1 ) {
$opentag = '<p>' ;
}
if ($i = ($max-1) ) {
$closetag = '</p>' ;
}
$out = $opentag . $lines[$i] $closetag ;
}
echo $out ;
?>`