Closed fooness closed 4 years ago
Yes, it is quietly easy. Method 'scan()' return a collection. Just do the next thing:
$networks = \Sanchescom\WiFi\WiFi::scan()->unique('ssid')->sortBy('ssid')->getAll();
Thank you so much, that works perfectly.
Is there any documentation available for questions like mine above? Feels like there’s very lots of great features in php-wifi.
Oh, I didn't even think of that. I will definitely expand the documentation. Thanks a lot.
Is it possible to sort the $networks array(?) alphabetically by ssid and also to display each ssid only once?
Tried it with
array_unique()
, but couldn’t figure out how to modify $networks in any way.Here’s what I’m using on my Kirby CMS page: