PHP code example of hatchetaustralia / fakerphp-loremflickr-kittens

1. Go to this page and download the library: Download hatchetaustralia/fakerphp-loremflickr-kittens 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/ */

    

hatchetaustralia / fakerphp-loremflickr-kittens example snippets


$faker = \Faker\Factory::create();
$faker->addProvider(new \Hatchet\FakerLoremFlickrKittens\FakerLoremFlickrKittensProvider($faker));

// return a string that contains a url like 'https://loremflickr.com/800/600/kitten'
$faker->imageUrl($width = 800, $height = 600); 

// download a properly sized image from LoremFlickr into a file with a file path like '/tmp/13b73edae8443990be1aa8f1a483bc27.jpg'
$filePath= $faker->image($dir = '/tmp', $width = 640, $height = 480);