【发布时间】:2020-03-19 12:20:01
【问题描述】:
我定义了一个常量:
define('ROOT_URL', dirname(__FILE__));
我将它与调用 png 图像的路径的第二部分一起使用。
<img src="<?php echo ROOT_URL ?>/images/folder1/logo-black.png" nosend="1" border="none" width="129" height="34" />
图像返回损坏,我的路径不是应有的。 (但当我链接它时,它仍然向我显示图像)。
就像:
C:\wamp64\www\email-signatures/images/folder1/logo-black.png"
它带有 \ 和 / 。
我做错了什么?
【问题讨论】:
-
所以我需要它是 ROOT_URL 。 'img/imeslike.jpg' as localhost:8080/img/logo-black.png 所以在服务器上导入时很容易定义。? @RiggsFolly
标签: php html directory constants