1. Go to this page and download the library: Download jkphl/responsive-images-css 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/ */
jkphl / responsive-images-css example snippets
use Jkphl\Respimgcss\Ports\Generator;
$breakpoints = ['24em', '36em', '48em']; // CSS Breakpoints
$emToPixel = 16; // EM to PX ratio
$generator = new Generator($breakpoints, $emToPixel);
// Use a `srcset`-like combined file name + width descriptor string ...
$generator->registerImageCandidate('small-400.jpg 400w');
// ... or an explicit width / resolution descriptor as second argument
$generator->registerImageCandidate('medium-800.jpg', '800w');
$generator->registerImageCandidate('large-1200.jpg', '1200w');