PHP parse_ini_file relative path?

I have this code:

$test = parse_ini_file("../data/test.ini"); 

test.ini is back in one directory and then sent to the data folder. But the problem I get is that parse_ini_file is not like when I make this relative file link, can anyone help me do this without an absolute file link?

+4
source share
1 answer

You can try the following:

 $test = parse_ini_file(realpath("../data/test.ini")); 

See this link

Or you can just use the absolute path directly.

+2
source

All Articles