Jump to content

File names and contents


witakr

Recommended Posts

Yeah, i tried that, php.net confuses me still because im still learning...

 

this is what i have thusfar... so i got the dir listing.. i just don't know how to strip the unwanted characters...

 

$files = glob("$filesdir*.txt");

foreach ($files AS $file)
{
$filecon = file_get_contents($file);

echo $file."<BR><BR>";
   //echo $filecon."<BR>";
}

 

the output is

playerfiles/dsxfv.txt

 

playerfiles/jason.txt

 

playerfiles/jeff.txt

 

playerfiles/jimmy.txt

 

playerfiles/mindy.txt

 

playerfiles/ron.txt

 

 

i need "playerfiles/" and ".txt" stripped, leaving just the person's name

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.