PHPackages                             undercoder/magenizer - 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. undercoder/magenizer

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

undercoder/magenizer
====================

Implements Iterator interface over a String for extract data with an array of tokens. The name comes from Mage and tokenizer :)

v0.1.9(6y ago)04MITPHPPHP &gt;=5.6.11

Since Dec 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/profe-ajedrez/Magenizer)[ Packagist](https://packagist.org/packages/undercoder/magenizer)[ RSS](/packages/undercoder-magenizer/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (9)Used By (0)

Magenizer
=========

[](#magenizer)

Implements Iterator interface over a String for extract data with an array of tokens. The name comes from Mage and tokenizer :)

Given an array of tokens, lets iterate over a String, returning every time the corresponding data between the corresponding tokens.

Ex.:

```
$raw =  array("from" => "ELECTRONIC",   "to" => "N\s*\°"),
  "doc-number"  => array("from" => "N\s*\°",       "to" => "WORK"),
  "job"         => array("from" => "K AT\:",       "to" => ",\nADDRESS"),
  "address"     => array("from" => "ADDRESS\s*\:", "to" => "\...Some")
);

$mage = new Magenizer($raw, $tokens);
foreach ($m as $next) {
  echo "$next ";
}

//OUTPUT:
//------
//ANDRES REYES
//3
// HEROICAL SERVICES FOR FREE
// 666, Where The Braves Dies Street, Santiago, Chile.
```

As you could see in the example, regexr are supported, but without the delimiting */* because they are added internally.

@author Andrés Reyes

Short Story
-----------

[](#short-story)

I wrote this class when at work I had to extract data from a raw string produced by the output of pdftotext. This output was very irregular and its disposition changed from case to case, so I thought the data as a target surrounded by a starting token and an ending token. E.g. (the &lt;&gt; are only for the example): ` Ermistuligius Of Bermelloauis  12  145 ..etc...`So, I could fetch the data pointing to the string between the tokens. At that time, I was studying design patterns, so I implemented this solution using the iterator pattern.

Disclaimer
----------

[](#disclaimer)

- I'm a novice programmer, so feedback is always welcomed.
- Some coworkers ask me to submit this to Packagist.
- I'm a native Spanish speaker.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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 ~1 days

Total

8

Last Release

2326d ago

PHP version history (2 changes)v0.1.2PHP &gt;=5.3.0

v0.1.9PHP &gt;=5.6.11

### Community

Maintainers

![](https://www.gravatar.com/avatar/0acf0514ef676baf7e43f3e8a83c92a887465da7c859ae833bf497b58657cd0a?d=identicon)[undercoder](/maintainers/undercoder)

---

Top Contributors

[![profe-ajedrez](https://avatars.githubusercontent.com/u/20423399?v=4)](https://github.com/profe-ajedrez "profe-ajedrez (15 commits)")

### Embed Badge

![Health badge](/badges/undercoder-magenizer/health.svg)

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

PHPackages © 2026

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