Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP parse_ini_file relative path?

I have this code:

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

test.ini is located back one directory and then forwards into the data folder. But the problem I'm getting is parse_ini_file doesn't like when I make this relative link to the file, can anyone help me do this without making a absolute link to the file?

like image 330
KillerKode Avatar asked Dec 25 '12 14:12

KillerKode


1 Answers

You could try this:

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

See this link

Or you could just use the absolute path directly.

like image 76
Matteo Tassinari Avatar answered Sep 18 '22 01:09

Matteo Tassinari