PHPackages                             mtabe/replacer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mtabe/replacer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mtabe/replacer
==============

"replaces query placeholders with params variables"

20PHP

Since Jul 14Pushed 6y agoCompare

[ Source](https://github.com/zechtz/replacer)[ Packagist](https://packagist.org/packages/mtabe/replacer)[ RSS](/packages/mtabe-replacer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

About
=====

[](#about)

A simple php library that helps replace sql query with given params

The test is included in the tests directory

Using the libary
================

[](#using-the-libary)

```
composer require mtabe/replacer
```

Then in your project include it

```
use Mtabe\Replacer;
```

```
$params = [
  'name'       => 'jonh snow',
  'start_date' => '12-01-2019',
  'end_date'   => '12-12-2019'
];

$query = "SELECT * FROM users WHERE first_name = '#P{name}' AND start_date = '#P{start_date}' AND end_date = '#P{end_date}'";

$response = Replacer::replaceWithParams($query, $params);

will return
SELECT * FROM users WHERE first_name = 'jonh snow' AND start_date = '12-01-2019' AND end_date = '12-12-2019'
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/471f19ec5b81276851ecb322cd4a575468d69831b9984468c42960bfa1756d04?d=identicon)[zechtz](/maintainers/zechtz)

---

Top Contributors

[![zechtz](https://avatars.githubusercontent.com/u/5102513?v=4)](https://github.com/zechtz "zechtz (9 commits)")

### Embed Badge

![Health badge](/badges/mtabe-replacer/health.svg)

```
[![Health](https://phpackages.com/badges/mtabe-replacer/health.svg)](https://phpackages.com/packages/mtabe-replacer)
```

###  Alternatives

[unisolutions/silverstripe-copybutton

Adds copy button to the GridField.

1736.4k](/packages/unisolutions-silverstripe-copybutton)[shomisha/stubless

A package for generating PHP files without stubs.

397.1k3](/packages/shomisha-stubless)[sagautam5/local-states-nepal

PHP Package for data set of local states of Nepal

334.7k](/packages/sagautam5-local-states-nepal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
