我搬到现场,一个新的托管(PHP 5.6),并在此之后,我得到这个错误:PHP的警告:非法串偏移“路径”和“标题”
PHP Warning: Illegal string offset 'path' in /home/sitedirectory/public_html/website/templates/all_files.php on line 4
下面是该文件
<?php defined('DIR') OR exit ?>
<div class="atachment"><?php echo (l()=='ge') ? 'Attached Documents' : 'Attachments'; ?></div>
<?php foreach($files as $file) : ?>
<div class="pdf"><a href="<?php echo $file['path'];?>"><?php echo $file['title'];?></a></div>
<?php endforeach; ?>
我怎样才能解决这个问题?
哪里是'被定义$ files'? – FrankerZ
'$ files'包含什么? – arkascha
通过不尝试使用字符串值,就好像它是一个数组... – CBroe