PHP code example of xvladqt / faker-lorem-flickr
1. Go to this page and download the library: Download xvladqt/faker-lorem-flickr 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/ */
xvladqt / faker-lorem-flickr example snippets
$faker = \Faker\Factory::create();
$faker->addProvider(new \Xvladqt\Faker\LoremFlickrProvider($faker));
$faker->imageUrl($width = 640, $height = 480); // 'http://loremflickr.com/640/480/'
$faker->imageUrl($width, $height, ['cats']); // 'http://loremflickr.com/640/480/cats/'
$faker->imageUrl($width, $height, ['cats', 'dogs']); // 'http://loremflickr.com/640/480/cats/'
$faker->imageUrl($width, $height, ['cats'], true); // 'http://loremflickr.com/640/480/cats/?random=1'
$faker->imageUrl($width, $height, ['cats'], true, true); // 'http://loremflickr.com/g/640/480/cats/?random=1' Monochrome image
$faker->image($dir = '/tmp', $width = 640, $height = 480); // '/tmp/13b73edae8443990be1aa8f1a483bc27.jpg'
$faker->image($dir, $width, $height, ['cats']); // 'tmp/13b73edae8443990be1aa8f1a483bc27.jpg' it's a cat!
$faker->image($dir, $width, $height, ['cats'], false); // '13b73edae8443990be1aa8f1a483bc27.jpg' it's a filename without path
$faker->image($dir, $width, $height, ['cats'], true, false); // it's a no randomize images (default: `true`)
$faker->image($dir, $width, $height, ['cats'], true, true, true); // 'tmp/13b73edae8443990be1aa8f1a483bc27.jpg' it's a monochrome image cat. Default, `null`.