simple way to edit textfiles?
| From: | Patrick | Date: | Tue, 21 Jan 2003 19:34:09 +0000 |
| Subject: | simple way to edit textfiles? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-132498@lists.php.net to get a copy of this message | ||
Hi,
i want to edit just one post in the middle of 100 posts, i use this code to
loop thru the posts
$fp = fopen($servername, "r") or die("error");
$wuser = file($servername);
$num = -1;
for ($i=0; $i < count($wuser); $i++) {
$wtemp = explode(";;", $wuser[$i]);
if ($ausername == $wtemp[0]) {
$num = $i;
$wserver = explode(";;", $wuser[$i]);
}
}
fclose($fp);
if ($num == -1) {
die ("error 2");
}
the post is $num (eg. 50) and when the uses has made his changes i want to
loop thru all and update just this post?
its probebly very simple, i just cant find it in the book :/
regards
patrick