|
Posted by Cleverbum on 03/21/06 18:19
Hi,
been scratching my head for a while on this one and was wondering how
what was going wrong. I dont mind at this stage if the actual thing I'm
trying to do, just why on earth it wont accept that the variable is a
string and get on with it!!
the code is below, with the problem line highlighted.
<?
$myCounter=0;
$tabStr="";
$outStr[0]="";
myScanDir(".");
print_r($outStr);
function myScanDir($dir){
global $myCounter, $mytabStr, $outStr, $tablength;
$fileslist= scandir($dir);
for($i=0;$i<count($fileslist);$i++){
if(is_dir($fileslist[$i])){
$outStr[$myCounter]= $tabStr . $fileslist;
$myCounter ++;
$tabStr .= " ";
$myScandir($fileslist[$i])
// the line below is the one which causes the errors.
$tabStr = substr($tabStr, 0, strlen($tabStr)-12);
}else{
$outStr[$myCounter]=$tabStr . $fileslist;
$myCounter++;
}
}
}
?>
Navigation:
[Reply to this message]
|