PHP解析错误:语法错误,意外的T
您好,我在执行代码时出现错误:PHP解析错误:语法错误,意外的T_CONSTANT_ENCAPSED_STRING,期待','或';' 在第28行的C: apache2triad htdocs imagedisplay.php中
<?php
$dir= "C:apache2triadhtdocsphppgadminimagesphpimages";
$file_display= array('jpg', 'jpeg', 'png', 'gif');
if(file_exists($dir)== false)
{
echo "directory x not found";
}
else
{
$dir_content= scandir($dir);
foreach($dir_content as $file)
{
$file_type = strtolower(end(explode('.', $file)));
// echo "$file <br> ";
if($file !=='.' && $file !=='..')
{
//echo "$file <br> ";
echo "<img src="', $dir, '/', $file, '" alt="', $file, '"/>";
}
}
}
?>
请帮忙
echo "<img src="', $dir, '/', $file, '" alt="', $file, '"/>";
^^-- here
你基本上有两个不同的字符串背对背,使这条线完全无效。
链接地址: http://www.djcxy.com/p/11969.html