Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
おはようございます、
PHP で開始 IP と終了 IP からサブネット マスクを取得しようとしています。
Eg; 14.1.32.0 and 14.1.64.0 is 255.255.224.0
しかし、これには組み込み関数がないようですか?私が検索したものはすべてCDIRを参照しており、すべてのipsなどを取得しようとしているため、別の方法で行こうとしているようです.
誰にもアイデアはありますか?
これにより、必要なものが得られるはずです。
$ip = "14.1.32.0"; $ip2 = "14.1.64.0"; echo long2ip(ip2long($ip) - ip2long($ip2));