On Thu, Aug 09, 2001 at 01:15:41PM -0400, Jaxon wrote:
> hmm...yes, it does work, I jumped the gun on the simple example, cuz I
> thought it was an echo problem..
> my un-simplified example has an opendir() in function foo() file.
> 
> 
> function.php is:
> <?php
>       function foo{
>       global $bar;
>       echo "$bar from foo"; //this is working
>       $handle=opendir("$bar/common/"); // I get a "OpenDir - no such file or
> directory"
>       //some more stuff here to handle directory maniuplaion
>       }
>       foo();
> ?>
> 
> so the simple example does indeed work, but the opendir() is choking trying
> to deal with the variable.
> 
> hmmm...
> 
> jaxon
> 


Are you sure the directory you try to open actualy exists?

Btw... for things like this you better use:

if (!($handle = opendir ("$bar/common/"))) {
  // Some error here, and don't try to use $handle after this!
}

-- 

* R&zE:

-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to