PHP code example of yanick-k / images-faker-lorem

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

    

yanick-k / images-faker-lorem example snippets


use Faker\Factory as Faker;

$faker = Faker::create();
$faker->addProvider(new \Lorem\Faker\LoremSpaceProvider($faker));

 $url = $faker->loremSpaceUrl(\Lorem\Faker\LoremSpaceProvider::CATEGORY_FACE); // https://api.lorem.space/image/face?w=640&h=480
// download image to tmp dir
$path = $faker->loremSpace(\Lorem\Faker\LoremSpaceProvider::CATEGORY_FACE)