Created
May 18, 2021 10:32
-
-
Save dmj/5266a87f0216d56960206a339c0965e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"hab/picarecord": "^1.1", | |
"hab/picareader": "^1.2" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use HAB\Pica\Record\Record; | |
use HAB\Pica\Reader\PicaNormReader; | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$ppn = '1018291776'; | |
$psiTemplate = 'https://kataloge.uni-hamburg.de/DB=1/PLAIN=Y/CHARSET=UTF-8/PLAINTTLCHARSET=UTF-8/PPN?PPN=%s'; | |
$psiUrl = sprintf($psiTemplate, $ppn); | |
$content = file_get_contents($psiUrl); | |
$reader = new PicaNormReader(); | |
$reader->open($content); | |
$record = $reader->read(); | |
$fields = $record->getFields('201@'); | |
print_r($fields); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment