PHP code example of sonypradana / fake-nik

1. Go to this page and download the library: Download sonypradana/fake-nik library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sonypradana / fake-nik example snippets


fakeNIK()->generate();
// 3212135412780001 (16 digit random nik)

fakeNIK()
    ->jenisKelamin(JenisKelamin::Laki)
    ->provinsi(Provinsi::JAWA_TENGAH)
    ->usia(17)
    ->generate();
// 3324140501060002 (controll your faker)

fakeNIK()
    ->jenisKelamin(JenisKelamin::LAKI)
    ->date(new \DateTime('12-12-2012'))
    ->generate();
// 3424141212120018 (controll your faker)