1. Go to this page and download the library: Download msztorc/svg-convert 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/ */
msztorc / svg-convert example snippets
$svg = (new SVG)->init('phantomjs');
$svg = (new SVG)->init('rsvg');
$svg = (new SVG)->init('phantomjs', 'inputfile.svg');
$svg->setFormat('png');
$svg->convert();
$svg->save('outputfile.png');
$svg = (new SVG)->init('phantomjs', 'inputfile.svg');
$svg->setAttribute('path', 'fill', '#131C77'); //change fill color to all paths
$svg->setFormat('png');
$svg->convert();
$svg->save('outputfile.png');
$svg->open('file.svg'); //open file
$svg->setZoom(2.5); //enlarge original svg size up to 2.5x