PHPackages                             mikefunk/query-stringer - 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. mikefunk/query-stringer

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

mikefunk/query-stringer
=======================

A simple query string helper to modify, get, and replace query strings.

2226PHP

Since Aug 16Pushed 12y ago1 watchersCompare

[ Source](https://github.com/mikedfunk/QueryStringer)[ Packagist](https://packagist.org/packages/mikefunk/query-stringer)[ RSS](/packages/mikefunk-query-stringer/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/8c105062b10fed3dabdcf0755dbb9f7feb8dd1e08d53e94cf4cf5ff8c708c19e/68747470733a2f2f7472617669732d63692e6f72672f6d696b656466756e6b2f5175657279537472696e6765722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mikedfunk/QueryStringer) [![Coverage Status](https://camo.githubusercontent.com/a5ccc7257a11d84b23cc12a45254f246e9ad3f0741b537db62f562bd187e28df/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d696b656466756e6b2f5175657279537472696e6765722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/mikedfunk/QueryStringer)

QueryStringer
=============

[](#querystringer)

A simple query string helper that will let you:

- get a query string with key/values added
- get a query string with keys removed (blacklist)
- get a query string with only a subset of keys (whitelist)
- combine any of these
- use the helper to assemble a new query string
- get the result as an array
- get the result as a string

Installation
------------

[](#installation)

Add this to your composer.json:

`"mikefunk/query-stringer": "dev-master"`

then run `composer update` and you're ready to use query stringer!

Usage
-----

[](#usage)

```
// assume the current document's query string is britney=spears&michael=jackson
$query_stringer = new MikeFunk\QueryStringer;

// returns ?michael=jackson
$query_stringer->without(['britney'])->get();

// returns ?britney=spears&michael=jackson&joe=schlabotnik
$query_stringer->with(['joe' => 'schlabotnik'])->get();

// returns array('britney' => 'spears', 'michael' => 'jackson')
$query_stringer->getArray();

// returns ?master=splinter
$query_stringer->replaceWith('master' => 'splinter')->get();

// returns ?michael=jackson
$query_stringer->only(['michael'])->get();

// if the current document's query string is not set, returns an empty string.
// no question mark.
$query_stringer->get();
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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://avatars.githubusercontent.com/u/661038?v=4)[Mike Funk](/maintainers/mikedfunk)[@mikedfunk](https://github.com/mikedfunk)

---

Top Contributors

[![mikedfunk](https://avatars.githubusercontent.com/u/661038?v=4)](https://github.com/mikedfunk "mikedfunk (8 commits)")

### Embed Badge

![Health badge](/badges/mikefunk-query-stringer/health.svg)

```
[![Health](https://phpackages.com/badges/mikefunk-query-stringer/health.svg)](https://phpackages.com/packages/mikefunk-query-stringer)
```

PHPackages © 2026

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