PHP code example of neam / php-sie

1. Go to this page and download the library: Download neam/php-sie 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/ */

    

neam / php-sie example snippets


$mySieFileDataSource = new MySieFileDataSource($this);
$sieFileDocument = $mySieFileDataSource->generateSieDocument();
$sieFileContents = $sieFileDocument->render();
file_put_contents('sie_file.se', $sieFileContents);

$file_contents = file_get_contents('sie_file.se');
$parser = new \sie\Parser();
$sie_file = $parser->parseSieFileContents($file_contents);
return $this->parse($data);

// The company name
puts sie_file.entries_with_label("fnamn").first.attributes["foretagsnamn"]

// The first account number
puts sie_file.entries_with_label("konto").first.attributes["kontonr"]

$sie_file = $parser->parse($utf8_string);

$parser = new \sie\Parser(["lenient" => true]);