starter91php
15.07.2009, 12:57:05
Witam, uzywam w swoim skrypcie 2 funkcji - file_get_contents i file_put_contents.
Tej pierwszej aby pobrac z pliku okreslony kontekst, np znaki od 10 do 20, a druga, zeby je tam wstawic.
Niestety skrypt ten musze wstawic na serwer ze starsza wersja php (4.4), gdzie funkcje te nie maja obslugi kontekstu pliku, czym moge je zastapic?
wookieb
15.07.2009, 12:58:37
Przeczytaj komentarze
http://pl2.php.net/file_get_contents<?php
//PHP 4.2.x Compatibility function
if (!function_exists('file_get_contents')) {
{
if (false === $fh = fopen($filename, 'rb', $incpath)) { trigger_error('file_get_contents() failed to open stream: No such file or directory', E_USER_WARNING
); return false;
}
$data = fread($fh, $fsize); } else {
$data = '';
$data .= fread($fh, 8192
); }
}
return $data;
}
}
?>
Analogicznie file_put_contents