Skip to content

A PHP lib to handle image inlining in your (css, img src, etc.)

License

Notifications You must be signed in to change notification settings

PuKoren/php-inline-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inline-images

Latest Stable Version Build Status codecov Code Climate Total Downloads

A PHP lib to handle image inlining in your (css, img src, etc.)

Install

composer require koren/inline-images

Convert an image to an inline string value

<?php

$inliner = new InlineImages\Converter('/path/to/img.png');

echo '<img src="'.$inliner->convert().'"/>';
//or for css
echo 'background: url('.$inliner->convert().')';

Convert a remote image to inline string value

<?php

$inliner = new InlineImages\Converter('http://path/to/img.png');

echo '<img src="'.$inliner->convert().'"/>';
//or for css
echo 'background: url('.$inliner->convert().')';

Inline SVGs

<?php

$inliner = new InlineImages\Converter('/path/to/img.svg');

echo '<img src="'.$inliner->convert().'"/>';
//or for css
echo 'background: url('.$inliner->convert().')';

About

A PHP lib to handle image inlining in your (css, img src, etc.)

Resources

License

Stars

Watchers

Forks

Packages

No packages published