A PHP lib to handle image inlining in your (css, img src, etc.)
composer require koren/inline-images
<?php
$inliner = new InlineImages\Converter('/path/to/img.png');
echo '<img src="'.$inliner->convert().'"/>';
//or for css
echo 'background: url('.$inliner->convert().')';
<?php
$inliner = new InlineImages\Converter('http://path/to/img.png');
echo '<img src="'.$inliner->convert().'"/>';
//or for css
echo 'background: url('.$inliner->convert().')';
<?php
$inliner = new InlineImages\Converter('/path/to/img.svg');
echo '<img src="'.$inliner->convert().'"/>';
//or for css
echo 'background: url('.$inliner->convert().')';