You can replace both tests by a single like the following:
```
if($pconfig['ipprotocol'] != $gwg_data['ipprotocol'])
    continue;
```