Thursday, November 30, 2006

creating large no of file in a folder using php

# in this pgm i created only 100 files, u  can  change the no
<?
for($i=0;$i<100;$i++)
{
$name="";
$msg="";
    for($j=0;$j<4;$j++)
    {
     $name.=chr(rand(97,122));
    }
    for($j=0;$j<100;$j++)
    {
     $msg.=chr(rand(97,122));
    }
$filename=$folder.$name.".txt";
$fd=fopen($filename,"w+");
$fout=fwrite($fd,$msg);
fclose($fd);
}
?>

No comments:

Post a Comment