1. Go to this page and download the library: Download arindam/svg 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/ */
// just pass the raw svg code
SVG::svgCodeToImageSave($rawSvgCode));
// OUTPUT:
// also want, you can pass file name as well
SVG::svgCodeToImageSave($rawSvgCode, "mysvg.svg"));
//OUTPUT: mysvg.svg