开发者

Parse error: syntax error, unexpected '{' in [closed]

This question is unlikely to help any future visitors; it is only relevant t开发者_JS百科o a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

This is my current code:

$directory = "polls/";
$dir = opendir($directory);

while (($file = readdir($dir)) !== false {

  $filename = $directory . $file;
  $type = filetype($filename);
  if ($type == 'file') {
     $contents = file_get_contents($filename);
     $items = explode('¬', $contents);
     echo '<table width="500" border="1" cellpadding="4">';
     foreach ($items as $item) {
       echo "<tr><td>$item</td></tr>\n";
     }
     echo '</table>';
  }
}
closedir($dir);

For some reason this line is giving me an error:

while (($file = readdir($dir)) !== false {

Parse error: syntax error, unexpected '{' in


Balance your parentheses:

while (($file = readdir($dir)) !== false) {


it should be

while (($file = readdir($dir)) !== false) {
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜