Jump to content


Photo

Glob Problem


  • Please log in to reply
1 reply to this topic

#1 holowugz

holowugz
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 24 March 2006 - 07:39 PM

Ok i need be able to echo the filenames and sizes of all files that end in .ctt and are in a specific directory, the directory will always be named the current date (GMT)

now this doesnt work and i am not sure why

<?php

$dir = gmdate('d-m-Y');
foreach(glob("$dir/*.ctt") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
?>

#2 holowugz

holowugz
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 24 March 2006 - 08:12 PM

$dir = gmdate('d-m-Y');
$arrayFiles= glob("$dir/*.ctt");
if($arrayFiles){
foreach ($arrayFiles as $filename) {
echo "$filename size <br>";
}
}else{
echo "No files";
}


Fixed it, it works now lol ty




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users