PHP code example of rudolfbyker / php-marc-csl
1. Go to this page and download the library: Download rudolfbyker/php-marc-csl 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/ */
rudolfbyker / php-marc-csl example snippets
// Get a MARC record (e.g. from an XML file)
$record = Record::fromSimpleXMLElement(simplexml_load_file("marc/xml/35663.xml"));
// Wrap the record in the class provided by this package.
$marcCsl = new MarcCslVariables($record);
// Get the CSL variables as a PHP data structure.
$csl_variables = $csl_variables->jsonSerialize();
// Get the CSL variables as a CSL-JSON string.
$json_string = json_encode($csl_variables);
shell script
composer