zualex / parsertext
This is a PHP class to parse the text using the template
1.0.0
2016-10-11 06:34 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2025-02-01 22:08:21 UTC
README
This is a PHP class to parse the text using the template.
Installation
composer require zualex/parsertext
Exmaple
require_once __DIR__ . '/vendor/autoload.php'; use \ParserText\ParserText; $parserSms = new ParserText(' Никому не говорите пароль! Его спрашивают только мошенники. Пароль: {% password %} Перевод на счет {% receiver %} Вы потратите {% sum %}р. '); print_r($parserSms->run(' Никому не говорите пароль! Его спрашивают только мошенники. Пароль: 72946 Перевод на счет 410011068150008 Вы потратите 5025,13р. '));
Result:
[
'password' => '72946',
'receiver' => '410011068150008',
'sum' => '5025,13',
]