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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.