rendered paste body<?php
// Open and read mybot.txt
$fp = fopen('/home/zeonicre/bot/iroffer/mybot.txt', 'rt');
if (!$fp)
{
echo 'ERROR: No such file exists.';
exit;
}
while (!feof($fp))
{
$line = fgets($fp);
// Skip commented lines.
if(substr($line, 0, 1)=='#') continue;
// Retrieve data columns
list ($file_info, $file_name) = split('] ', $line);
// Remove all funny characters from $file_info
$file_info = str_replace('', '', $file_info);
// Add the closing bracket back to $file_info
$file_info = str_replace('M', 'M]', $file_info);
$file_info = str_replace('K', 'K]', $file_info);
echo '<tr><td>'.$file_info.'</td><td>'.$file_name.'</td></tr>';
$fp++;
}
fclose($fp);
?>