|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-11-12 14:30 UTC] derick@php.net
[2002-11-12 14:31 UTC] iliaa@php.net
[2002-11-12 14:31 UTC] dromar84 at msn dot com
[2002-11-12 15:45 UTC] dromar84 at msn dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 11:00:01 2025 UTC |
The following PHP script is stable on *NIX platforms but unstable on Win32 platorms. <?php $LineLength = 50; $uploadfile = 'PATH TO IMAGE'; $uploadfile_name = 'PATH TO IMAGE'; $fd = fopen ($uploadfile, "r"); $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", $LineLength, "'.'"); print $imgcode; ?>