You WILL get false positives using this method for getting online status.
The following code is what I use within XboxAPI
// Find the Presence Data and set it.
@preg_match('~<div class="presence">(.*?)</div>~si', $response, $online);
$data['Player']['Status']['Online'] = ((@preg_match('~Online~si', $online[1]) == true) && ($online[1] != 'Online Status Unavailable'));
$data['Player']['Status']['Online_Status'] = trim($online[1]);
Yes this can and should probably be optimised more, but the code is now over 2 years old and still working flawlessly
You WILL get false positives using this method for getting online status.
The following code is what I use within XboxAPI
Yes this can and should probably be optimised more, but the code is now over 2 years old and still working flawlessly