jeyroik/preg

There is no license information available for the latest version (1.3.1) of this package.

Simple preg replace wrapper

Maintainers

Details

github.com/jeyroik/preg

Source

Issues

Installs: 436

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:project

1.3.1 2019-02-19 11:14 UTC

This package is auto-updated.

Last update: 2024-10-29 05:10:38 UTC


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!