Code: Select all
<?php
$IDs = preg_split("/[\s]*[,][\s]*/", $_REQUEST['IDs']);
$myFile = "IDs.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
for ( $counter = 0; $counter < count($IDs); ++$counter)
{
fwrite($fh, $IDs[counter]."\n");
echo $IDs[counter]."\n";
}
fclose($fh);
?>Solved