Re: Problem w/ reading a txt file.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sub@xxxxxxxxx wrote:
 Problem w/ reading a txt file.
The error I get is "Warning: opendir(/home/pudlz/public_html ): failed to
 open dir: No such file or directory "
Here's my code:: $main = file('folders.txt');
 $counter = count($main);
for($i=0;$i<$counter;$i++)
 {
  if ($handle = opendir("$main[$i]"))
  {
     $b=0;
   }
 }
It's reading and extra space at the end of all my lines. How do I prevent
 that?

$main = file('folders.txt');
foreach($main as $folder)
{
   if ($handle = opendir(trim($folder))
   {
       $b = 0;
   }
}

I really don't see the point in this loop, but maybe you gave a very simple example.

Warmly,
Burhan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux