php - is there a better way to do this? fopen, fread, fwrite -


this question has answer here:

is there better way this:

$countfile = fopen("count.txt", 'r'); $read = fread($ebf, filesize("count.txt"));  $ebn = $read+1; fclose($ebf); $ebf = fopen($ebc, 'w'); fwrite($ebf, $ebn); 

i wrote script counting visits

you can achieve same results via file_get_contents , file_put_contents:

$read = file_get_contents("count.txt"); $ebn = $read+1; file_put_contents($ebc, $ebn); 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -