View Single Post
Old 04-30-2007, 11:36 AM  
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
Quote:
Originally Posted by uno View Post
some code that would also contain the name of the file-ext. in the file.
ok well heres how you do it in php

make a folder somewhere

put the code below in a file called index.php

make a folder called results. this is where the created files willl be saved ( chmod the folder to be writeable )

save the list in a file called file.txt ( in the same folder as index.php )

Code:
<?php

$fil = "file.txt";
$sc = file_get_contents($fil);
$emt = explode("\n",$sc);

   foreach( $emt as $pn => $mub){

$dub = str_replace(" ","-",$mub);
$wrt = "STUFF INSIDE FILE $dub.txt";
$fol = "results/$dub.txt";
echo "Saved $dub.txt \n<br>";
$hn = fopen($fol, 'w+');
fwrite($hn, $wrt);
fclose($hn);
}
?>
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote