oni4i/fake-nz-generator

There is no license information available for the latest version (1.3) of this package.

Fake New Zeland data generator

1.3 2023-08-17 13:53 UTC

This package is auto-updated.

Last update: 2025-03-29 12:08:17 UTC


README

Downloads

PHP Generator of New Zealand valid data like IP, zip code and city

composer require oni4i/fake-nz-generator

If you need fake, but valid data like IP, ZIP code and City you can use this PHP library.

Generate random city

$cityGenerator = new CityGeneratorService();

//output "Ahaura"
$randCity1 = $cityGenerator->rand();

//output "Athol"
$randCity2 = $cityGenerator->rand();

Generate IPs

$ipGenerator = new IPGeneratorService();

//output "14.1.32.0"
$firstIP = $ipGenerator->first();

//output "14.1.32.1"
$nextIP = $ipGenerator->next($firstIP);

//output "14.1.32.0"
$prevIP = $ipGenerator->prev($firstIP);

//output "14.1.95.255"
$randIP = $ipGenerator->rand();

Generate ZIP codes

$zipGenerator = new ZipGeneratorService();

//output "7550"
$randZipCode = $zipGenerator->rand();

//output "9749"
$randZipCodeByCity = $zipGenerator->randByCity('Athol');