Preposition replace library
PHP Prepositioner for replacing prepositions with after preposition
Install package via composer:
$ composer require tomaj/prepositioner
Simple usage without Factory is very simple:
$prepositioner = new Tomaj\Prepositioner\Prepositioner(array('one', 'two')); $prepositioner->formatText($inputText);
This example replaces all occurences of 'one' or 'two' strings in
$inputText as 'one ' and 'two '.
For using with Factory which contains language support try:
$prepositioner = Tomaj\Prepositioner\Factory::build('slovak') $prepositioner->formatText($inputText);
For new language support you need to implement new language class which implements LanguageInterface with prepositions. See SlovakLanguage for details.
- each new language has to be in Tomaj\Prepositioner namespace