Home  >  Article  >  Backend Development  >  输出图片乱码?求解答,该如何处理

输出图片乱码?求解答,该如何处理

WBOY
WBOYOriginal
2016-06-13 13:15:261300browse

输出图片乱码?求解答

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php $img=imagecreatefromgif("./images/1.gif");//自己随便找张gif图片

    echo "width:".imagesx($img)."px</br>";
    echo "height:".imagesy($img)."px";

    imagegif($img);

        
    imagedestroy($img);



发现width:XXX
  heigth:xxx输出正常,后面运行的图片打印就乱码了。但不要
  echo "width:".imagesx($img)."px";
echo "height:".imagesy($img)."px";
这2句,图片可以正常打印出来。为什么会这样呢?求解答

------解决方案--------------------
你可以写到图片里去嘛

无论学 php 多久,规矩一样都是要遵守的
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn