Re: odd behavior

From: Date: Wed, 01 May 2002 12:55:17 +0000
Subject: Re: odd behavior
Groups: php.general 
Request: Send a blank email to php-general+get-95513@lists.php.net to get a copy of this message
check clearstatcache() Charles Killmer ---------- Original Message ---------------------------------- From: "Craig Westerman" <westerman@chanuteks.com> Date: Tue, 30 Apr 2002 18:29:37 -0500 When I run this the first time, file.txt contains value of 30. Then I add 15 to it with following script and file now contains value of 45. I look at file.txt after write and it does indeed contain number 45. But when I run script 24 hours later via cron job, it still thinks file.txt is holding number 30. Is $file somehow retaining value of 30 and not getting new value of 45 when script runs second time? What is it called when this happens? <?php $file = file('/usr/home/xyz/file.txt'); //file.txt contains value of 30 $number = "15"; $newnumber = $file + $number; //$newnumber now is 45 $fp = fopen('/usr/home/xyz/file.txt','w'); fputs($fp,"$newnumber"); // write value 45 to file.txt fclose($fp); ?> Thanks Craig ><> westerman@chanuteks.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#95513) next »