Hi.
There are several ways to do these REGEX regular expressions.
Some will be more successful if the HTML page layout eventually will change.
Other REGEX will fail if the HTML page change, and so the REGEX will have to be modified.
I think my code below is reasonably good. And still not too complicated.
Of course there are possible additions to this code to improve it.
I have tested it at my PHP development webserver. And it works.
With the HTML example you posted.
<?php
/*
// Signal Strength
$signal = "-81";
// GPRS Attachment Status
$gprs_attach_status = "Attached";
// GPRS Registration
$gprs_reg = "Registered, home network";
// Service Provider Name
$provider_name = "SomeNet";
*/
$signal_find = '#(-{0,1}\d+) *dBm#siU';
preg_match($signal_find, $html, $match);
$signal = trim($match[1]);
echo $signal;
echo "<br />\n";
$attach_find = '#Attachment Status</TD><TD>(.*)<#siU';
preg_match($attach_find, $html, $match);
$gprs_attach_status = trim($match[1]);
echo $gprs_attach_status;
echo "<br />\n";
$reg_find = '#GSM Registration</TD><TD>(.*)<#siU';
preg_match($reg_find, $html, $match);
$gprs_reg = trim($match[1]);
echo $gprs_reg;
echo "<br />\n";
$provider_find = '#Provider Name</TD><TD>(.*)<#siU';
preg_match($provider_find, $html, $match);
$provider_name = trim($match[1], ' "');
echo $provider_name;
?>