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. [Templating &amp; Views](/categories/templating)
4. /
5. leonid-slv/php-rtf-template

ActiveLibrary[Templating &amp; Views](/categories/templating)

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.6kGPL-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 3w 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

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2030d 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)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)[awkwardideas/switchblade

Extended blade directives for laravel

102.1k](/packages/awkwardideas-switchblade)

PHPackages © 2026

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