A class which provides common methods to access and create Strings in BibTex format. An example would be:
$foo = new Structures_BibTex();
$ret=$foo->loadFile('foo.bib');
if(PEAR::isError($ret)) {
print $ret->getMessage();
die();
}
$foo->parse();
print "<pre>";
print_r($foo->data);
print "</pre>";
An example output would be:
Array
([0] => Array
(
[type] => article
[cite] => art1
[title] => Titel1
[author] => Array
(
[0] => John Doe
[1] => Jane Doe
)
)
[1] => Array
(
[type] => article
[cite] => art2
[title] => Titel2
[author] => Array
(
[0] => John Doe
[1] => Jane Doe
)
)
)
A more useful example would be parsing an existing BibTex file and adding an entry:
$foo = new Structures_BibTex();
$foo->loadFile('IFHEM.bib');
$foo->parse();
$addarray = array();
$addarray['type'] = 'Article';
$addarray['cite'] = 'art1';
$addarray['title'] = 'Titel1';
$addarray['author'][0] = 'John Doe';
$addarray['author'][1] = 'Jane Doe';
$foo->addEntry($addarray);
print 'There are '.$foo->amount().' entries';
And of course it is possible to export it again in BibTex Format:
print "<pre>";
print $foo->bibTex();
print "</pre>";
Take control of your digital assets with the Uniswap Exchange Asset Control Panel, offering comprehensive tools for managing and optimizing your crypto portfolio. |