Jump to content

Return fwrite 3 times...


Huijari

Recommended Posts

Ok, so I previously posted a problem and got fix on it. Unfortunately I found that my script doesn't work like I want it to do.

 

Here's the code:

 

if(!file_exists($file)){	
$fh=fopen($file, 'w');
if ($iii>0) {
fwrite($fh,"&s" .$iii. "x=$x_coord2,&s" .$iii. "y=$y_coord'w'\n");
$iii -1;
} else {
fclose($fh);
echo "<br/>";
echo "ok<br/><br/>";
}

 

 

Ok, so now $iii is number 3 for example. And if its greater than 0, it will write to file. But it should do fwrite 3 times, always when $iii -1;

 

 

It should do this 3 times:

fwrite($fh,"&s" .$iii. "x=$x_coord2,&s" .$iii. "y=$y_coord'w'\n");

 

And  all 3 would be same but $iii in then would be 3,2,1

 

So how to do it so, it always return to do fwrite if $iii is greater than 0?

Link to comment
https://forums.phpfreaks.com/topic/189563-return-fwrite-3-times/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.