ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
◀ ilDoc Overview
Structures_BibTex_example.php
Go to the documentation of this file.
1
<?php
2
error_reporting(E_ALL);
3
require_once
'PEAR.php'
;
4
require_once
'Structures/BibTex.php'
;
5
$bibtex
=
new
Structures_BibTex
();
6
//Loading and parsing the file example.bib
7
$ret
=
$bibtex
->loadFile(
'example.bib'
);
8
if
(
PEAR::isError
(
$ret
)) {
9
print
$ret
->getMessage();
10
die();
11
}
12
$bibtex
->parse();
13
//Creating an entry
14
$addarray
= array();
15
$addarray
[
'entryType'
] =
'Article'
;
16
$addarray
[
'cite'
] =
'art2'
;
17
$addarray
[
'title'
] =
'Titel2'
;
18
$addarray
[
'author'
][0][
'first'
] =
'John'
;
19
$addarray
[
'author'
][0][
'last'
] =
'Doe'
;
20
$addarray
[
'author'
][1][
'first'
] =
'Jane'
;
21
$addarray
[
'author'
][1][
'last'
] =
'Doe'
;
22
//Adding the entry
23
$bibtex
->addEntry(
$addarray
);
24
//Printing the result
25
echo
"Converting This Array:\n\n"
;
26
echo
"<pre>"
;
27
print_r(
$bibtex
->data);
28
echo
"\nInto this:\n\n"
;
29
echo
$bibtex
->bibTex();
30
echo
"<hr />"
;
31
echo
"\nAnd here is the RTF String:\n\n"
;
32
echo
$bibtex
->rtf();
33
echo
"<hr />"
;
34
echo
"\nAnd here are the data in HTML:\n\n"
;
35
echo
$bibtex
->html();
36
echo
"<hr />"
;
37
echo
"\nAnd here is the statistic:\n\n"
;
38
print_r(
$bibtex
->getStatistic());
39
echo
"</pre>"
;
40
?>
$ret
$ret
Definition:
Structures_BibTex_example.php:7
$bibtex
$bibtex
Definition:
Structures_BibTex_example.php:5
Structures_BibTex
PEAR\isError
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition:
PEAR.php:279
$addarray
$addarray
Definition:
Structures_BibTex_example.php:14
Modules
Bibliographic
lib
PEAR_BibTex_1.0.0RC5
docs
examples
Structures_BibTex_example.php
Generated on Mon Aug 25 2025 19:00:31 for ILIAS by
1.8.13 (using
Doxyfile
)