0) { $flags += NL80211_BAND_24GHZ; } if (count(preg_grep('/^5[0-9]{3}/i', $frequencies)) >0) { $flags += NL80211_BAND_5GHZ; } echo json_encode($flags); }