a PHP Bibtex Library

So, you've published a nice number of papers, keep their details in a .bib file, and want to easily display them on a website? Or, you've got yourself some content on your website in which you would like to include some citations, and show the relevant publications below?

Look no further.

Enter, phpBibLib

phpBibLib provides you an easy and modular way of parsing and displaying the contents of a .bib file. You can query the contents of the bibtex file either directly, or by making cites within a text.
As an example of the former, say we want to display the publications of author 'Vreeken' in the year 2011:

$bib = new Bibtex('references.bib');
$bib->Select(array('author' => 'Vreeken', 'year' => 2011));

Which gives as output:

[1] Mampaey, M., Tatti, N. & Vreeken, J. Tell Me What I Need To Know: Succinctly Summarising Data by Itemsets. In Proc. KDD'11, 2011.
[2] Miettinen, P. & Vreeken, J. Model Order Selection for Boolean Matrix Factorization. In Proc. KDD'11, ACM, 2011.
[3] Remmerie, N., Vijlder, T.D., Valkenborg, D., Laukens, K., Smets, K., Vreeken, J., Mertens, I., Carpentier, S., Panis, B., Jaeger, G.d., Prinsen, E. & Witters, E. Unraveling tobacco BY-2 protein complexes with BN PAGE/LC-MS/MS and clustering methods. Journal of Proteomics, Elsevier, 2011.
[4] Smets, K. & Vreeken, J. The Odd One Out - Identifying and Characterising Anomalies. In Proc. SDM'11, 2011.
[5] Tatti, N. & Vreeken, J. Comparing Apples and Oranges: Measuring Differences between Data Mining Results. In Proc. ECMLPKDD'11, 2011.

Which is pretty neat, for such simple code.

Alternatively, we could have some content in which we would like to refer to bibliographic entries printed below. E.g.

This and that has long been known to be such and so <?=cite('vreeken24', 'siebes06', 
'DBLP:journals/tkde/MiettinenMGDM08');?>. Furthermore, <?=citet('agrawal93')?> 
clearly did not <?=cite('agrawal93')?>.

with which we get

This and that has long been known to be such and so [?,1,2]. Furthermore, Agrawal et al. [3] clearly did not [3].

[1] Siebes, A., Vreeken, J. & van Leeuwen, M. Item Sets that Compress. In Proc. SDM'06, pages 393-404, 2006.
[2] Miettinen, P., Mielikäinen, T., Gionis, A., Das, G. & Mannila, H. The Discrete Basis Problem. IEEE Trans. Knowl. Data Eng., 20(10):1348-1362, 2008.
[3] Agrawal, R., Imielinksi, T. & Swami, A. Mining association rules between sets of items in large databases. In Proc. SIGMOD'93, pages 207-216, ACM, 1993.

Which, again, is pretty neat, especially considering we can handle different bibliographic styles (numeric, abbreviated, natbib), orders, and can combine the above demonstrated cites and selections; all through a very simple interface.


The library (currently v1.0.7, 13/01/2021) can be downloaded here.

phpBibLib is postcard-ware, that is, it may be used freely for non-commercial purposes; if you use it, however, I would be thrilled to receive a (tacky!) (touristy!) real postcard from wherever you are (see here for my current address). (If you are a cheapskate, or afraid of postcards, just let me know by email that you use it.)


Documentation for the library is, well, neither not yet completely finished nor very likely to become so in the near future. Instead, I do provide live demonstrations here and here for the static, and sqlite cached versions respectively.

In addition, I provide basic templates that should help you to get quickly started with phpBibLib.

Since v1.0.5, undocumented features include a) regular-expression based selection of references, b) fixed ordering, c) linking the title of a reference according to the tag 'paperurl' in the bibtex file, d) setting a base directory for if that target is a (eg PDF) file.

Since v1.0.7, the library is PHP7 compliant by using long opening tags, proper constructors. Besides numerous small fixes, now many more types of funky characters are supported.


The main author of the library is Jilles Vreeken. Many thanks go to Siegfried Nijssen, Tobias Oetiker, Franck Samson, Joseph Tam, Lucas Treffenstadt, Guenter Weber, and Jan Maik Wissing for fixing bugs, and introducing features.