jeyroik / preg
Simple preg replace wrapper
Installs: 436
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
README
Simple preg replace wrapper.
Deprecated. Moved to jeyroik/extas-foundation as Replace.
Install
composer require jeyroik/preg:1.0
Usage
use jeyroik\tools\components\Preg; $s = 'Hello, @user.name! You hit this page @user.stat.hits times!'; $preg = new Preg(); echo $preg->apply([ 'user' => [ 'name' => 'JeyRoik', 'stat' => [ 'hits' => 10 ] ] ])->to($s);
Result will be:
Hello, JeyRoik! You hit this page 10 times!