PHPackages                             leonid-slv/php-rtf-template - 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. leonid-slv/php-rtf-template

ActiveLibrary

leonid-slv/php-rtf-template
===========================

Simple library for working with templates. Works on any PHP version, no additional libraries or dependencies are used. RTF files can be used from under any text editor, including MS Word. Supported formats UTF-8 and CP1251.

v1.0(5y ago)01.6k↓100%GPL-3.0PHP

Since Dec 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Leonid-SLV/PHP-RTF-Template)[ Packagist](https://packagist.org/packages/leonid-slv/php-rtf-template)[ RSS](/packages/leonid-slv-php-rtf-template/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

PHP RTF Template
================

[](#php-rtf-template)

Simple library for working with templates. Works on any PHP version, no additional libraries or dependencies are used. RTF files can be used from under any text editor, including MS Word. Supported formats UTF-8 and CP1251.

The library looks for the text in the \[template\] view and replaces it with a value.

Examples:
---------

[](#examples)

More examples can be found in the /Examples

Simple easy example:

```
$rtf = '{\rtf1\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset204 Calibri;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang1033 Hello\f1\lang1049  \f0\lang1033 [template], my name PHP RTF Template!\lang9\par
}
';
$rtf = rtf_easy_replace($rtf,'template','world');

```

Normal replace:

```
$rtf = '{\rtf1\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset204 Calibri;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang1033 Hello\f1\lang1049  \f0\lang1033 [template], my name PHP RTF Template!\lang9\par
}
';
$template = rtf2template($data);
foreach ($template as $value)
  {
    if (rtf_compare('template','world')
      {
        $template = str_replace('['.'template'.']',text2rtf('world'),$rtf);
     }
  }

```

About:
======

[](#about)

```
 *@Author	Selvistrovich Leonid
 *@Mail		crack-it@yandex.com
  @version	1.0, 02.12.2020

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

1985d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bc2bad9ee69819941c5e47767fb43541eac4d0132b2cc937f46ee7d53f2bb08?d=identicon)[Leonid-SLV](/maintainers/Leonid-SLV)

---

Top Contributors

[![Leonid-SLV](https://avatars.githubusercontent.com/u/72562621?v=4)](https://github.com/Leonid-SLV "Leonid-SLV (8 commits)")

### Embed Badge

![Health badge](/badges/leonid-slv-php-rtf-template/health.svg)

```
[![Health](https://phpackages.com/badges/leonid-slv-php-rtf-template/health.svg)](https://phpackages.com/packages/leonid-slv-php-rtf-template)
```

PHPackages © 2026

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