Php 图像src(url)不工作

Php 图像src(url)不工作,php,html,Php,Html,我有下面这样的图像标签 <img src="www.example.com/imgs/file.jpg" /> 但这不起作用,当我看到页面src时,我看到 <img src="site1/std/www.example.com/imgs/file.jpg" /> 我试图通过添加 <img src="../../www.example.com/imgs/file.jpg" /> 但这只是给我: <img src="../../sit

我有下面这样的图像标签

<img src="www.example.com/imgs/file.jpg" />

但这不起作用,当我看到页面src时,我看到

<img  src="site1/std/www.example.com/imgs/file.jpg" />

我试图通过添加

<img  src="../../www.example.com/imgs/file.jpg" />

但这只是给我:

<img  src="../../site1/std/www.example.com/imgs/file.jpg" />


我的代码有什么问题?

如果映像位于脚本所在的服务器上,则可以使用

<img src="imgs/file.jpg" />

如果它在一个外部站点上,那么你需要使用完整的链接,就像这样

<img src="http://www.example.com/imgs/file.jpg" />


您需要在此处或相对路径添加
http://
元素使用
href
,而不是
src
。也不工作。我喜欢这种“不工作”。没有足够的信息来支持这个问题,这个php是如何相关的?对不起,它的img不正确;这是在评论中说的,但他们没有测试它在外部网站上,但它给了我类似的信息,所以你需要获得图像的完整链接,这样图像链接可以放在浏览器中,然后生成图像。所以前面需要http://