|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-09-25 04:54 UTC] cquadalti at libero dot it
function encode_file($sourcefile) {
if (is_readable($sourcefile)) {
$fd = fopen($sourcefile, "r");
$contents .= fread($fd,filesize($sourcefile));
$encoded = chunk_split(base64_encode($contents));
fclose($fd);
}
return $encoded;
}
$source = $DOCUMENT_ROOT."/IMAGES/titolomail.gif";
encode_file($source);
fopen also don't work with "rb" option and system return a memory violation error
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 03:00:01 2025 UTC |
function encode_file($sourcefile) { if (is_readable($sourcefile)) { $fd = fopen($sourcefile, "r"); $contents = fread($fd,filesize($sourcefile)); $encoded = chunk_split(base64_encode($contents)); fclose($fd); } return $encoded; } $source = $DOCUMENT_ROOT."/IMAGES/titolomail.gif"; encode_file($source); fopen also don't work with "rb" option and system return a memory violation error