Hi, Kathryn:
You could try this. I commented it so you could see what I was thinking:
<?php
// define file to read
$file = 'sample02.txt';
// make sure file exists
if(file_exists($file)){
// get contents and turn into a variable/string
$contents = file_get_contents($file);
// strip some things out of contents here
// strip_tags() and trim() as examples
$contents = strip_tags($contents );
$contents = trim($contents);
// define the new file you wish to create
$file2create = 'sample03.txt';
// create handle
$handle = fopen($file2create, 'w');
// write NEW file
$result = fwrite($handle, $contents);
// if the file was created and written to
if($result){
echo 'contents written to file[' . $file2create . ']';
}
// else error message
else {
echo 'contents could NOT be written to file[' . $file2create . ']';
}
}
// else
else {
echo 'the file [' . $file . '] does NOT exist';
}
?>
I hope this helps....
edit (after reading Bretticus): I was going under the assumption that the files were on your server...