-
read file
Using PHP
--------------
I have this folder on my web site
Mail
Public_html
Mail is folder that I recive my email on it
Public_html is folder that I must upload my site files to it
How can I read file using fopen function from Mail folder ?
If I use that
fopen ("/mail/file.txt")
it will read file from here (Public_html/Mail/file.txt) becuase Public_html is the root folder but I want read file from Mail folder.
Thanks
-
You can do a chdir to change the working directory...
-
or you could just use the absolute path in fopen().
However, if you just want to read the file to a variable, just do:
$stuff = file("/path/to/your/file.txt");