【问题标题】:How to include a .bib file in php如何在 php 中包含 .bib 文件
【发布时间】:2016-03-22 09:59:44
【问题描述】:

我需要创建一个我正在使用 Log.bib 文件的 OPC 文件,并且我想在不使用任何插件的情况下将它包含在 php 中。

我尝试过使用 include 或 require 但它不起作用。

require_once 'Log.bib';
include 'Log.bib';

【问题讨论】:

  • .bib 文件不是 PHP 或文本文件,因此如果没有解析这些 BibText 文件的第三方插件,则无法包含它们。
  • 你需要file_get_contents("filename.bib")然后通过手动解析内容的过程,或者你可以做理智的事情并利用别人的工作(例如people.mmci.uni-saarland.de/~jilles/prj/phpBibLib)而不是重新发明轮子。
  • @C0dekid 你能推荐任何插件吗?
  • @Adityayadav 你可以试试这个:people.mmci.uni-saarland.de/~jilles/prj/phpBibLib(另见关于 file_get_contents 的评论。
  • 其实我想调用一个存在于Log.bib文件中的函数(带参数),我们如何在php中调用这个函数(带参数)。

标签: php shell include require biblatex


【解决方案1】:

PHP 不能包含或读取没有特定库的 BIB 文件: 使用 PHP BibText 库

https://people.mmci.uni-saarland.de/~jilles/prj/phpBibLib/

或任何其他库,例如:

http://www.monperrus.net/martin/bibtexbrowser/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-11
    • 2014-12-07
    • 1970-01-01
    • 2020-09-29
    • 2018-05-22
    • 2011-05-10
    • 2016-11-04
    • 2015-10-24
    相关资源
    最近更新 更多