Create Image From Url Any File Type

后端 未结 7 1696
无人及你
无人及你 2020-12-02 17:25

I know of imagecreatefromgif(), imagecreatefromjpeg(), and imagecreatefrompng() but is there a way to create an image resource (for png preferably) from a url of any

7条回答
  •  时光说笑
    2020-12-02 18:03

    This may help you

    $image = imagecreatefromstring(file_get_contents('your_image_path_here'));

    Example: $image = imagecreatefromstring(file_get_contents('sample.jpg'));

提交回复
热议问题