1
2
3
4
5
6
7
8
9
|
<?php
header(
"Content-type:image/jpeg"
);
$resource
=
fopen
(
'001.png'
,
'r'
);
while
(
$ff
=
fread
(
$resource
, 1024)){
$file
.=
$ff
;
};
echo
$file
;
|
原因分析:因为存在一个notice错误。
$file .= $ff;
原型为:
$file = $file.$ff;
中间的$file没有定义,会报错
解决方法:
方案一:关闭wamp的notice错误提示。
1
|
error_reporting
(E_ALL & ~E_NOTICE);
|
方案二:在前面定义下$file=”;