PHP code example of zanson / sm-parser

1. Go to this page and download the library: Download zanson/sm-parser 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/ */

    

zanson / sm-parser example snippets


    $sm = new Zanson\SMParser\FileParser\SM();
    $sm->parse(dirname(__DIR__).'/test.sm');
    $convert = new \Zanson\SMParser\Model\Convert();
    $ssc = $convert->SMtoSSC($sm->song);

    $ssc = new Zanson\SMParser\FileParser\SSC();
    $ssc->parse(dirname(__DIR__).'/test.sm');
    $convert = new \Zanson\SMParser\Model\Convert();
    $sm = $convert->SSCtoSM($ssc->song);

$ssc = new Zanson\SMParser\FileParser\SSC();
$ssc->parse(file_get_contents(dirname(__DIR__) . '/test.ssc'));
file_put_contents($ssc->getFileName(), $ssc->export());

$ssc = new Zanson\SMParser\Model\SSC();
$parse = new Zanson\SMParser\FileParser\SSC();
$parse->setSong($ssc);
file_put_contents($parse->getFileName(), $parse->export());