imagecreatefrompng() returns an image identifier representing the image obtained from the given filename.
imagecreatefrompng() returns an empty string on failure. It also outputs an error message, which unfortunately displays as a broken link in a browser. To ease debugging the following example will produce an error PNG:
提示: 如果 "fopen wrappers" 已经被激活,则您在使用该函数的时候,可以把 URL 作为文件名来使用。请参阅 fopen() 获取怎样指定文件名的详细信息以及支持的 URL 协议的列表 附录 I。
警告 |
Windows 版本的 PHP 在 4.3.0 版之前不支持该函数的远程文件访问,即使 allow_url_fopen 选项已被激活。 |