Hi all!
I have an app which reads from certain servers, but I'd like to have
them in am ini-file.
I made this up, but I need those vars to be visible in functions
too.... how do I do that?
BR
Sonnich
// default ini values
$dir1="\\\\serv er1\\finance";
$dir2="\\\\serv er2\\design\\";
// read in settings
$ini=fopen("con fig.ini", "r");
while(!feof($in i))
{
$line=fgets($in i, 100);
if(stristr($lin e, 'dir1') == TRUE)
{
$dir1=strstr($l ine, '=');
$dir1=trim(subs tr($dir1, 1, 1000));
}
else if(stristr($lin e, 'dir2') == TRUE)
{
$dir2=strstr($l ine, '=');
$dir2=trim(subs tr($dir2, 1, 1000));
}
}
fclose($ini);
I have an app which reads from certain servers, but I'd like to have
them in am ini-file.
I made this up, but I need those vars to be visible in functions
too.... how do I do that?
BR
Sonnich
// default ini values
$dir1="\\\\serv er1\\finance";
$dir2="\\\\serv er2\\design\\";
// read in settings
$ini=fopen("con fig.ini", "r");
while(!feof($in i))
{
$line=fgets($in i, 100);
if(stristr($lin e, 'dir1') == TRUE)
{
$dir1=strstr($l ine, '=');
$dir1=trim(subs tr($dir1, 1, 1000));
}
else if(stristr($lin e, 'dir2') == TRUE)
{
$dir2=strstr($l ine, '=');
$dir2=trim(subs tr($dir2, 1, 1000));
}
}
fclose($ini);
Comment