symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.15k stars 5.1k forks source link

[HttpFoundation] [http-foundation] Check if ip is in cidr subnet #20082

Closed damienfern closed 1 month ago

damienfern commented 1 month ago

While I was searching a way to check if an IP is included in a CIDR subnet, I found this old stack overflow : https://stackoverflow.com/questions/594112/check-whether-or-not-a-cidr-subnet-contains-an-ip-address

This old question has of course an old answer but also has a "recent" one that might answer to 99% use cases of Symfony devs. And should be in the documentation.

javiereguiluz commented 1 month ago

Thank you Damien.