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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cleverbum@hotmail.com

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

    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<cou nt($fileslist); $i++){
    if(is_dir($file slist[$i])){
    $outStr[$myCounter]= $tabStr . $fileslist;
    $myCounter ++;
    $tabStr .= "&nbsp;&nbs p;";
    $myScandir($fil eslist[$i])
    // the line below is the one which causes the errors.
    $tabStr = substr($tabStr, 0, strlen($tabStr)-12);
    }else{
    $outStr[$myCounter]=$tabStr . $fileslist;
    $myCounter++;
    }
    }
    }
    ?>

  • Oli Filth

    #2
    Re: Can't work out reason behind &quot;unexpecte d T_VARIABLE&quot ; error

    Cleverbum@hotma il.com wrote:[color=blue]
    > 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.
    >[/color]
    <...SNIP CODE...>

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


    --
    Oli

    Comment

    • Cleverbum@hotmail.com

      #3
      Re: Can't work out reason behind &quot;unexpecte d T_VARIABLE&quot ; error

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

      Comment

      Working...