fwrite and sort
| From: | Sebastian | Date: | Mon, 21 Mar 2005 20:29:36 +0000 |
| Subject: | fwrite and sort | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211210@lists.php.net to get a copy of this message | ||
i have a form with checkboxes which after POST it writes to a file.
i would like to allow the user to sort the selected checkbox filename in the
order they want it written to file.
so i was thinking creating an input text box where they can enter a number,
then have it written to file in that order.. question is how?
the script starts like such:
foreach($_POST['map'] AS $file)
{
if(file_exists('/maps/'.trim($file)))
{
$found .= $file;
}
}
if (file_exists($mapcycle) && $found)
{
$fp = fopen($mapcycle, 'w');
fwrite($fp, $found);
fclose($fp);
}
any help is appreciated.