이미지 base64_encode() 처리
로빈아빠
본문
$uploadfile = "이미지전체경로";
$fd = fopen ($uploadfile,"rb");
$size=filesize ($uploadfile);
$c=substr("$uploadfile_name",strrpos($uploadfile_name,".")+1);
$cont = fread ($fd, $size);
fclose ($fd);
$encimg=base64_encode($cont);
$imgcode=chunk_split("$encimg",50,"'.'");
$fd = fopen ($uploadfile,"rb");
$size=filesize ($uploadfile);
$c=substr("$uploadfile_name",strrpos($uploadfile_name,".")+1);
$cont = fread ($fd, $size);
fclose ($fd);
$encimg=base64_encode($cont);
$imgcode=chunk_split("$encimg",50,"'.'");
echo base64_decode($imgcode);
관련링크
댓글목록
등록된 댓글이 없습니다.