PHP code example of wafarifki / cipta-nama
1. Go to this page and download the library: Download wafarifki/cipta-nama 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/ */
wafarifki / cipta-nama example snippets
afarifki\CiptaNama\CiptaNama;
$generator = new CiptaNama();
// Generate nama lengkap secara acak
echo "Nama Lengkap Acak: " . $generator->generateNamaLengkap();
echo '<br><br>';
// Generate nama lengkap pria secara acak
echo "Nama Lengkap Acak Pria: " . $generator->generateNamaLengkap('pria');
echo '<br><br>';
// Generate nama lengkap wanita secara acak
echo "Nama Lengkap Acak Wanita: " . $generator->generateNamaLengkap('wanita');
echo "<br><br>";
$daftarNamaPria = $generator->generateDaftarNama(5, 'pria');
echo "5 Daftar Nama Pria: <br>";
foreach ($daftarNamaPria as $nama) {
echo $nama;
echo "<br>";
}
echo "<br>";
$daftarNamaWanita = $generator->generateDaftarNama(5, 'wanita');
echo "5 Daftar Nama Wanita: <br>";
foreach ($daftarNamaWanita as $nama) {
echo $nama;
echo "<br>";
}
echo "<br>";
$daftarNamaRandom = $generator->generateDaftarNama(10, 'random');
echo "5 Daftar Nama Random: <br>";
foreach ($daftarNamaRandom as $nama) {
echo $nama;
echo "<br>";
}