[SOLVED] reading from a file
Posted: Fri Jun 11, 2004 10:51 am
Hi I can read my file ok with this code
Personalities : [raid1] read_ahead 1024 sectors md0 : active raid1 hde1[1] hdg1[0] 39078016 blocks [2/2] [UU] [======>..............] resync = 34.9% (13670876/39078016) finish=41.0min speed=10324K/sec unused devices:
All I want out of it is
resync = 34.9%
finish=41.0min
Can I pull out just that part of the file?
Code: Select all
<?php
if (!($fp = fopen("/proc/mdstat", "r")))
exit("Unable to open the input file.");
while (!feof($fp))
{
$c = fgetc($fp);
print $c;
}
fclose($fp);
?>All I want out of it is
resync = 34.9%
finish=41.0min
Can I pull out just that part of the file?