Skip to content

Instantly share code, notes, and snippets.

@drajathasan
Created January 27, 2023 07:15
Show Gist options
  • Save drajathasan/e0c2909bc0081a8ab03c67b4f446cd10 to your computer and use it in GitHub Desktop.
Save drajathasan/e0c2909bc0081a8ab03c67b4f446cd10 to your computer and use it in GitHub Desktop.
Consume OAI PMH result in SLiMS
$modsxml = Client::get('https://slims-online/oai2.php?verb=ListRecords&metadataPrefix=oai_dc')->getContent();
$xml = @new SimpleXMLElement($modsxml);
foreach ($xml->ListRecords->record as $record) {
$data = $record->metadata->children('oai_dc', 1)->dc->children('dc', 1);
dump($record->asXML(), $record->metadata->children('oai_dc', 1)->dc->children('dc', 1));
break;
}
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment