PHPackages                             jerryaicn/word - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jerryaicn/word

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jerryaicn/word
==============

从word中解析试题

1.0.8(2y ago)015PHP

Since Feb 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jerryaicn2023/word)[ Packagist](https://packagist.org/packages/jerryaicn/word)[ RSS](/packages/jerryaicn-word/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (1)Versions (10)Used By (0)

说明文档
====

[](#说明文档)

模板
--

[](#模板)

### 试卷模板

[](#试卷模板)

模板支持word和html，以行为单位进行解析，对于word来说，一个回车，视为一行，对于html来说，一对`p`标签，视为一行

#### 模板标签

[](#模板标签)

##### 题型

[](#题型)

顶格书写，当解析器遇到当前行为如下文字时，认为是`题型`:

- `单选题`
- `多选题`
- `判断题`
- `问答题`

> 题型可以省略，当题型省略时，解析器认为当前题目与上一题目是相同的题型

##### 题干

[](#题干)

顶格书写，当解析器遇到`*`开头时，认为是`题干`，题干可以为多行，也可以包括图片，题干的文字为多行时，仅能在第一行添加`*`

##### 选项

[](#选项)

顶格书写，当解析器遇到`A.`(大写字母+半角句点)开头时，认为是选择题的选项，选项可以为多行，也可以包括图片，选项的文字为多行时，仅能在第一行添加`A.`

> 仅选择题适用

##### 答案

[](#答案)

顶格书写，当解析器遇到`答案:`(汉字答案+英文冒号)开头时，认为是答案，答案为一行时，写在冒号之后，答案为多行或包括图片时，仅能在第一行添加`答案:`

##### 解析

[](#解析)

顶格书写，当解析器遇到`解析:`(汉字解析+英文冒号)开头时，认为是解析，解析为一行时，写在冒号之后，解析为多行或包括图片时，仅能在第一行添加`解析:`

安装
--

[](#安装)

```
composer install jerryaicn/word

```

使用
--

[](#使用)

### 将word转换为html

[](#将word转换为html)

```
$path = "./example.doxs";
$word = new \Jerryaicn\Word($path);
$word->getContentAsHtml()

```

### 从word中解析试题

[](#从word中解析试题)

```
$path = "./example.doxs";
$wordParser = new WordParser($path);
$wordParser->setDebug(true);
$examParser = new ExamParser();
$examParser->setDebug(true);
$raw = $wordParser->getContentAsHtml();
$result = $examParser->parseFromHtml($raw);

```

### 从html中解析试题

[](#从html中解析试题)

```
$path = "./example.doxs";
$wordParser = new WordParser($path);
$wordParser->setDebug(true);
$examParser = new ExamParser();
$examParser->setDebug(true);
$raw = $wordParser->getContentAsHtml();
$result = $examParser->parseFromHtml($raw);

```

例子
--

[](#例子)

examples 目录包括完整的示例，使用方法

```
cd examples
php -S 0.0.0.0:8000

```

用浏览器打开 `http://localhost:8000/exam.html` 和 `http://localhost:8000/outline.html`

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~2 days

Total

9

Last Release

822d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/238416105?v=4)[post70s](/maintainers/post70s)[@post70s](https://github.com/post70s)

---

Top Contributors

[![jerryaicn2023](https://avatars.githubusercontent.com/u/142473427?v=4)](https://github.com/jerryaicn2023 "jerryaicn2023 (14 commits)")

### Embed Badge

![Health badge](/badges/jerryaicn-word/health.svg)

```
[![Health](https://phpackages.com/badges/jerryaicn-word/health.svg)](https://phpackages.com/packages/jerryaicn-word)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k409.0k6](/packages/theodo-group-llphant)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1111.2k](/packages/abydahana-aksara)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
