PHP code example of jemer / faker

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

    

jemer / faker example snippets



use Jemer\Faker\Factory;

$user = new User(
    [
        "firstName" => Factory::Name_Man(),
        "lastName" => Factory::LastName(),
        "age" => Factory::Age_Adult(),
        "address" => Factory::Us_Address(),
        "email" => Factory::Email(),
        "password" => Factory::Password()
    ]
);


$blogPost = new BlogPost([
    "title" => Factory::Title(),
    "author" => Factory::Name_Man(),
    "published" => Factory::Date(),
    "content" => Factory::Paragraphs(8)
]);


echo Factory::Name_Man();

var_dump(Factory::Names_Men(7));
array