https://github.com/ip2location/cidr-to-ip
A PHP script to convert CIDR into IP address range in CSV file.
https://github.com/ip2location/cidr-to-ip
cidr cidr-to-ip-range ip-address ip-address-geolocation ip-address-lookup ip-range php-scripts
Last synced: about 1 year ago
JSON representation
A PHP script to convert CIDR into IP address range in CSV file.
- Host: GitHub
- URL: https://github.com/ip2location/cidr-to-ip
- Owner: ip2location
- License: mit
- Created: 2019-03-22T07:43:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T06:10:31.000Z (about 7 years ago)
- Last Synced: 2025-04-18T21:16:48.170Z (about 1 year ago)
- Topics: cidr, cidr-to-ip-range, ip-address, ip-address-geolocation, ip-address-lookup, ip-range, php-scripts
- Language: PHP
- Size: 4.88 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
``` bash
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