im having a bit of trouble loading it onto the website :S tried fopen with fread and fget and a whole load more but cant get it to read the first line from status.txt
$handle = fopen("bla.txt", "r");
while ( !feof($handle) )
{
$single_line = fgets($handle);
echo $single_line;
}
fclose($handle);
<?php
foreach (file('bla.txt') as $line)
echo $line;
?>
<?php
function config_parser_read($file)
{ # Function Returns array(0 => Array('Key' => 'KeyName', 'Val' => 'Value'), ect...); (PHP4)
foreach (file($file) as $line => $data)
list($return[$line]['key'][], $return[$line]['val'][]) = split('=', $data, 2);
}
function config_parser_write($file, $path)
{ # Function expects an array like that found in the config_parser_read function. (PHP5)
foreach ($file as $line = $data)
$file = $file[$line] = implode($data, '=');
$file = implode($file, PHP_EOL);
return file_put_contents($file, $path);
}
// Change only one line in the config.
$line = 12;
$key = 'AdminPass';
$val = 'Scawen';
$file = config_parser_read('config.ini');
$file[$line] = array('Key' => $key, 'Val' => $val);
?>