Re: Opening a file

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

 



Dan Shirah wrote:
I did a

if ($lines === false) {
echo "lines is false";
}

like you suggested and it displays that text...but it still make no sense.
mypage.php and fruits.txt are in the same folder, on the same server.  There
isn't any permissions issues.

So, if mypage.php and fruits.txt are in the same folder, then $lines =
file("fruits.txt") should be valid.

Is mypage.php the script you're calling or is it being included from a script in a different directory? The 'current directory' is the directory of the main script, not included scripts. Use dirname(__FILE__) to get the path to the current script.

-Stut

--
http://stut.net/

--
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