我写了一段完美运行的代码,但后来重新安装了操作系统,现在我尝试运行它时不断出现错误。我使用的是IIS 8.0、WebMatrix和PHP 5.3。
以下是有问题的代码片段:
以下是有问题的代码片段:
<?php
if (!$me->get_details()['quote']) : //<--error is here
?>
<p class="quote">Write some motivational quote.</p>
<?php
else :
?>
<p class="quote"><?= $me->get_details()['quote']?></p>
<?php endif; ?>
函数 get_details() 返回一个关联数组,其中包含来自数据库的数据。
这里可能会出现什么问题?