1. Go to this page and download the library: Download sirv/sirv-image 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/ */
sirv / sirv-image example snippets
use Sirv\SirvImage;
$url = (new SirvImage('https://demo.sirv.com/image.jpg'))
->resize(300, 200)
->format('webp')
->quality(80)
->toUrl();
// https://demo.sirv.com/image.jpg?w=300&h=200&format=webp&q=80
// Full image URL
new SirvImage('https://demo.sirv.com/image.jpg');
// Base URL + path
new SirvImage('https://demo.sirv.com', '/image.jpg');