Giter Site home page Giter Site logo

ip2location / cidr-to-ip Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 2.0 5 KB

A PHP script to convert CIDR into IP address range in CSV file.

License: MIT License

PHP 100.00%
cidr ip-range php-scripts cidr-to-ip-range ip-address ip-address-lookup ip-address-geolocation

cidr-to-ip's Introduction

CIDR to IP Range

This PHP script converts CIDR into IP range (dotted format) in a CSV file. This converter only support IPv4 conversion.

Usage

php cidr-to-ip.php {INPUT_FILE} {OUTPUT_FILE}

Example:

php cidr-to-ip.php ip-cidr.csv ip-cidr-new.csv

Sample Input

"1.16.0.0/18","KR","Korea, Republic of"
"1.20.0.0/16","TH","Thailand"
"150.101.32.66/32","AU","Australia"
"212.214.138.0/28","SE","Sweden"
"216.224.227.128/27","US","United States"

Sample Output

"1.16.0.0","1.16.63.255","16384","KR","Korea, Republic of"
"1.20.0.0","1.20.255.255","65536","TH","Thailand"
"150.101.32.66","150.101.32.66","1","AU","Australia"
"212.214.138.0","212.214.138.15","16","SE","Sweden"
"216.224.227.128","216.224.227.159","32","US","United States"

Support

URL: https://www.ip2location.com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.