PHP code example of jp3cki / gimei

1. Go to this page and download the library: Download jp3cki/gimei 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/ */

    

jp3cki / gimei example snippets





use jp3cki\gimei\Gimei;

// echo $gimei . "\n";                     // "相沢 陽菜"
echo $gimei->kanji . "\n";              // "相沢 陽菜"
echo $gimei->hiragana . "\n";           // "あいざわ ひな"
echo $gimei->katakana . "\n";           // "アイザワ ヒナ"
echo $gimei->last->kanji . "\n";        // "相沢"
echo $gimei->last->hiragana . "\n";     // "あいざわ"
echo $gimei->last->katakana . "\n";     // "アイザワ"
echo $gimei->first->kanji . "\n";       // "陽菜"
echo $gimei->first->hiragana . "\n";    // "ひな"
echo $gimei->first->katakana . "\n";    // "ヒナ"

echo $gimei->isMale . "\n";             // false (echo の挙動上 "0")
echo $gimei->isFemale . "\n";           // true  ( 〃           "1")


use jp3cki\gimei\Gimei;

//     // 男性
echo $gimei->kanji . "\n";          // "山田 太郎"
echo $gimei->isMale . "\n";         // true  (echo の挙動上 "1")
echo $gimei->isFemale . "\n";       // false ( 〃           "0")

$gimei = Gimei::generateFemale();   // 女性
echo $gimei->kanji . "\n";          // "相沢 陽菜"
echo $gimei->isMale . "\n";         // false (echo の挙動上 "0")
echo $gimei->isFemale . "\n";       // true  ( 〃           "1")


use jp3cki\gimei\Gimei;

//     // 90% 男性、10% 女性
echo $gimei->kanji . "\n";          // "山田 太郎"


use jp3cki\gimei\Gimei;

// ;
echo $addr . "\n";                          // 岡山県大島郡大和村稲木町
echo $addr->kanji . "\n";                   // 岡山県大島郡大和村稲木町
echo $addr->hiragana . "\n";                // おかやまけんおおしまぐんやまとそんいなぎちょう
echo $addr->katakana . "\n";                // オカヤマケンオオシマグンヤマトソンイナギチョウ

echo $addr->prefecture->kanji . "\n";       // 岡山県
echo $addr->prefecture->hiragana . "\n";    // おかやまけん
echo $addr->prefecture->katakana . "\n";    // オカヤマケン

echo $addr->city->kanji . "\n";             // 大島郡大和村
echo $addr->city->hiragana . "\n";          // おおしまぐんやまとそん
echo $addr->city->katakana . "\n";          // オオシマグンヤマトソン

echo $addr->town->kanji . "\n";             // 稲木町
echo $addr->town->hiragana . "\n";          // いなぎちょう
echo $addr->town->katakana . "\n";          // イナギチョウ
sh
   php composer.phar init