I have to perform some work on a number of files that all have an 11 number ID tagged on the front of the file. Until now, I was using these functions:
function roundit($file1) {
$path = "../path/" . $file1;
$kb = (filesize("$path")/1024);
$round_kb = (round($kb));
$mb = ($round_kb / 1000);
$round_mb = (round($mb, 2));
$response = $round_mb;
return $response; }
$stripfrom = "19950120111"; #11 digit id
function makeset($filename) {
global $stripfrom;
$fsize = roundit("$filename");
echo "<a href=\"./wrapper.php?song=$filename\">";
$filename = (str_replace($stripfrom,"",$filename));
$filename2 = (str_replace("_"," ",$filename2));
$filename2 = (str_replace(".ogg"," ",$filename2));
echo $filename2 . " </a> ";
echo $fsize;
echo " MB<br>"; }
The problem is that now I have multiple IDs in the directory, so I need a function that doesn't strip specific characters, but rather the first 11 characters, regardless of value. Anyone know how I can accomplish this?
Thanks in advance,
-Adam
sethadam1@hotmail.com