Download the PHP package leonid-slv/php-rtf-template without Composer
On this page you can find all versions of the php package leonid-slv/php-rtf-template. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download leonid-slv/php-rtf-template
More information about leonid-slv/php-rtf-template
Files in leonid-slv/php-rtf-template
Download leonid-slv/php-rtf-template
More information about leonid-slv/php-rtf-template
Files in leonid-slv/php-rtf-template
Vendor leonid-slv
Package php-rtf-template
Short Description 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.
License GPL-3.0
Package php-rtf-template
Short Description 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.
License GPL-3.0
Please rate this library. Is it a good library?
Informations about the package 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:
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:
*@Author Selvistrovich Leonid
*@Mail [email protected]
@version 1.0, 02.12.2020
All versions of php-rtf-template with dependencies
PHP Build Version
Package Version
No informations.
The package leonid-slv/php-rtf-template contains the following files
Loading the files please wait ....