PHPackages                             andreekeberg/serialized-search-replace - 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. [Search &amp; Filtering](/categories/search)
4. /
5. andreekeberg/serialized-search-replace

ActiveLibrary[Search &amp; Filtering](/categories/search)

andreekeberg/serialized-search-replace
======================================

Search and replace serialized strings, and update all string lengths

1.1.0(5y ago)5311[2 issues](https://github.com/andreekeberg/serialized-search-replace/issues)1MITPHPPHP &gt;=4.0.0

Since Sep 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/andreekeberg/serialized-search-replace)[ Packagist](https://packagist.org/packages/andreekeberg/serialized-search-replace)[ Docs](https://github.com/andreekeberg/serialized-search-replace)[ RSS](/packages/andreekeberg-serialized-search-replace/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (1)

Serialized Search and Replace
=============================

[](#serialized-search-and-replace)

[![Latest Stable Version](https://camo.githubusercontent.com/70b6f02e35760bd562cdc0e8ae9a91ec15b0d1b1997b78b1158f0b8995caa11a/68747470733a2f2f706f7365722e707567782e6f72672f616e647265656b65626572672f73657269616c697a65642d7365617263682d7265706c6163652f762f737461626c65)](https://packagist.org/packages/andreekeberg/serialized-search-replace) [![Total Downloads](https://camo.githubusercontent.com/b107ba63d4d7ca1af21648b45f8534c42514b44dbb315f76bee3072dc6bb24a5/68747470733a2f2f706f7365722e707567782e6f72672f616e647265656b65626572672f73657269616c697a65642d7365617263682d7265706c6163652f646f776e6c6f616473)](https://packagist.org/packages/andreekeberg/serialized-search-replace) [![License](https://camo.githubusercontent.com/4860b3c766356f336b67367200f3ed3ef1435c2f8038cd19dca860376c15c303/68747470733a2f2f706f7365722e707567782e6f72672f616e647265656b65626572672f73657269616c697a65642d7365617263682d7265706c6163652f6c6963656e7365)](https://packagist.org/packages/andreekeberg/serialized-search-replace)

Easily replace strings found in content containing data serialized by the [serialize](https://www.php.net/manual/en/function.serialize.php) function without corrupting your data, by correcting all length values included in these objects before returning the replaced content.

Requirements
------------

[](#requirements)

- PHP 4.0.0 or higher

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

[](#installation)

```
composer require andreekeberg/serialized-search-replace

```

Usage
-----

[](#usage)

**Basic usage**

```
$output = SerializedSearchReplace::replace(
    'http://example.com',
    'https://example.com',
    serialize([
        'url' => 'http://example.com/'
    ])
);
```

Returns:

```
a:1:{s:3:"url";s:20:"https://example.com/";}

```

**Getting the number of replacements performed**

Passing `$count` by reference to get the total number of replacements performed:

```
$output = SerializedSearchReplace::replace(
    'http://example.com',
    'https://example.com',
    serialize([
        'url' => 'http://example.com/'
    ]),
    $count
);
```

Value of `$count`:

```
1

```

Documentation
-------------

[](#documentation)

- [SerializedSearchReplace](docs/SerializedSearchReplace.md)

Contributing
------------

[](#contributing)

Read the [contribution guidelines](CONTRIBUTING.md).

Changelog
---------

[](#changelog)

Refer to the [changelog](CHANGELOG.md) for a full history of the project.

License
-------

[](#license)

Serialized Search and Replace is licensed under the [MIT license](LICENSE).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

2071d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86bc1ee1c801495796569fefa0c1275d88542a5d74d5ddf04c4851e88351fa20?d=identicon)[andreekeberg](/maintainers/andreekeberg)

---

Top Contributors

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

---

Tags

libraryphpphp-libraryreplacesearchsearch-and-replacesearch-replaceserializeserializedserialized-dataunserializesearchserializeunserializereplaceserializedsearch-replace

### Embed Badge

![Health badge](/badges/andreekeberg-serialized-search-replace/health.svg)

```
[![Health](https://phpackages.com/badges/andreekeberg-serialized-search-replace/health.svg)](https://phpackages.com/packages/andreekeberg-serialized-search-replace)
```

###  Alternatives

[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M943](/packages/elasticsearch-elasticsearch)[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[solarium/solarium

PHP Solr client

93532.7M98](/packages/solarium-solarium)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)

PHPackages © 2026

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