Aktív témák
-
supercow
őstag
úgy tűnik hogy mégsem jó az fseek() megoldás, de itt egy másik:
[L]http://www.phpfreaks.com/quickcode/code/150.php[/L]
function write_beg($filename, $data)
{
//Imports old data
$handle = fopen($filename, ''r'');
$old_content = fread($handle, filesize ($filename));
fclose($handle);
//Sets up new data
$final_content = $data.$old_content;
//Writes new data
$handle2 = fopen($filename, ''w'');
$finalwrite = fwrite($handle2, $final_content);
fclose($handle2);
}
Minden esetre érdekes, hogy ez kimaradt az alap dolgok közül. -
supercow
őstag
$fp = fopen (''proba.txt'', ''a'');
$elejere = fseek($fp, 0)
fwrite ($fp, $proba);
fclose ($fp);
fseek
(PHP 3, PHP 4 )
fseek -- Seeks on a file pointer
Description
int fseek ( resource handle, int offset [, int whence])
Sets the file position indicator for the file referenced by handle.The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows:
SEEK_SET - Set position equal to offset bytes.
SEEK_CUR - Set position to current location plus offset.
SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
If whence is not specified, it is assumed to be SEEK_SET.
Aktív témák
- Számlás!Steam,EA,Epic és egyébb játékok Pc-re vagy XBox!
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- Xbox / Microsoft Store feltöltőkártya kód (digitális, HU) több címlet, több db, azonnal, olcsón
- Játékkulcsok olcsón: Steam, Uplay, GoG, Origin, Xbox, PS stb.
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- Dell Precision 7550 i7-10850H 32GB 512GB Nvidia RTX5000 16GB 1 év garancia
- Samsung Galaxy XCover 5 / 4/64GB / Kártyafüggetlen / 12Hó Garancia
- ÚJ Lenovo ThinkPad X13 Gen 5 - 13.3" WUXGA IPS - Ultra 5 135U - 16GB - 512GB - Win11 - 2,5 év gari
- GYÖNYÖRŰ iPhone XR 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS4270, 100% Akkumulátor
- Xiaomi Mi 11 T Pro 8/256GB / 12 hó jótállás
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
