By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 2,006 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

Can't work out reason behind "unexpected T_VARIABLE" error

P: n/a
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 .= "&nbsp;&nbsp;";
$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++;
}
}
}
?>

Mar 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Cl*******@hotmail.com wrote:
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.

<...SNIP CODE...>

Semi-colons...........
--
Oli

Mar 21 '06 #2

P: n/a
thanks, sorry for such a stupid post, i was sure that was the first
thing i checked!

Mar 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more PHP Questions on Bytes