I am opening the http port of a device and would like to filter out some data that is returned. but my regex commands arn't doing what I want...it seems to go a little weird arround the carriage return and new line...
Code: Select all
$pattern = '^(Video buffer underflows \(this connection\)\r\n1)^';
$connection = fopen("http://" .$IP. "/index.htm", "r");
if ($connection) {
while (!feof($connection)) {
$buffer = fgetss($connection, 4096);
$buffer = rtrim($buffer);
preg_match($pattern, $buffer, $match);
//echo $buffer;
print_r($match);
}
fclose($test);
}Video buffer underflows (this connection)
1
Ideally what I am after is the value '1' in a variable, this number could go as high as100000...
Code: Select all
Video buffer overflows (this connection)
0
Video buffer underflows (this connection)
1
Audio continuity errors (this connection)
0Many Thanks Ian[/quote]