Structures_BibTex
[ class tree: Structures_BibTex ] [ index: Structures_BibTex ] [ all elements ]

Source for file Structures_BibTex_example.php

Documentation is available at Structures_BibTex_example.php

  1. <?php
  2. require_once 'PEAR.php';
  3. require_once './Structures_BibTex.php';
  4.  
  5. $foo = new Structures_BibTex();
  6.  
  7. //Loading and parsing the file example.bib
  8. $ret=$foo->loadFile('example.bib');
  9. if(PEAR::isError($ret)) {
  10.     print $ret->getMessage();
  11.     die();
  12. }
  13. $foo->parse();
  14.  
  15. //Creating an entry
  16. $addarray = array();
  17. $addarray['type']               'Article';
  18. $addarray['cite']               'art2';
  19. $addarray['title']              'Titel2';
  20. $addarray['author'][0]['first''John';
  21. $addarray['author'][0]['last']  'Doe';
  22. $addarray['author'][1]['first''Jane';
  23. $addarray['author'][1]['last']  'Doe';
  24. //Adding the entry
  25. $foo->addEntry($addarray);
  26.  
  27. //Printing the result
  28. print "<pre>";
  29. print "Converting This Array:\n\n";
  30. print_r($foo->data);
  31. print "\nInto this:\n\n";
  32. print $foo->bibTex();
  33. ?>

Documentation generated on Mon, 11 Mar 2019 14:41:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.