如何在特殊网址中获取图像

时间:2013-05-22 16:57:25

标签: php image url curl

我看到了http://www.example.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/0这样的网址 访问它然后我可以得到一个图像 这个怎么运作? 如何通过php使用curl获取该图像的边界?

1 个答案:

答案 0 :(得分:2)

通过该网址获取图片是什么意思?您需要使用htaccess重写URL并使用PHP以某种方式拦截它并从某处加载文件。

获得图像后,您可以从中获得所需的任何信息。

  1. Rewrite URL with mod_rewrite (即:domain.com/23234234/0至domain.com?id=23234234&nr=0)
  2. 拨打请求ID为23234234
  3. 的文件的数据库
  4. Show it to the user changing the content-type of the file you are showing
  5. 你在寻找什么?