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