解析错误:语法错误,意外的'endif'(T_ENDIF),预期文件结尾

时间:2019-07-15 09:53:08

标签: php parsing syntax

我正在尝试运行这段代码

<?php endif

'''' 解析错误:语法错误,意外的'endif'(T_ENDIF),预期文件结尾

'''' ''''

  <?php endif;
    $books = [
    [
    'title' => 'To Kill A Mockingbird',
    'author' => 'Harper Lee',
    'available' => true,
    'pages' => 336,
    'isbn' => 9780061120084
    ],
    [
    'title' => '1984',
    'author' => 'George Orwell',
    'available' => true,
    'pages' => 267,
    'isbn' => 9780547249643
    ],
    [
    'title' => 'One Hundred Years Of Solitude',
    'author' => 'Gabriel Garcia Marquez',
    'available' => false,
    'pages' => 457,
    'isbn' => 9785267006323
    ],
    ];
    ?>
    <ul>
    <?php foreach ($books as $book): ?>
    <li>
    <i><?php echo $book['title']; ?></i>
    - <?php echo $book['author']; ?>
    <?php if (!$book['available']): ?>
    <b>Not available</b>
    <?php endif; ?>
    </li>
    <?php endforeach; ?>
    </ul>
    ?>   

''''

显示的错误

解析错误:语法错误,意外的'endif'(T_ENDIF),预计第1行的D:\ Active Project \ PHP \ Learnig PHP 7 \ 03LoopF​​inal \ index.php中的文件结尾

我试图寻找解决方案 纠正打字错误!

0 个答案:

没有答案