【发布时间】:2026-01-29 06:10:02
【问题描述】:
我正在制作图片幻灯片
$article = "This is the title of the slide show images";
现在正在定义路径
// set the absolute path to the directory containing the images
define ("IMGDIR", "./pathsubdir/$article/");
尝试过
define ('IMGDIR', '/articles/" . $article . "/');
不起作用(以上两者)
define ('IMGDIR', '/articles/"This is the title of the slide show images"/');
有效 ^
但是我怎样才能把它作为一个变量让它工作呢?因为 $article 是一个动态值
提前致谢
【问题讨论】: