PHPackages                             ybagheri/strfun - 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. ybagheri/strfun

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

ybagheri/strfun
===============

This is a handy little function to strip out a string between two specified pieces of text. This could be used to parse XML text, bbCode, or any other delimited code/text for that matter. based on justin-cook convert Persian/Arabic numbers to English numbers and vice versa

0327PHP

Since Mar 6Pushed 2w ago1 watchersCompare

[ Source](https://github.com/ybagheri/strFun)[ Packagist](https://packagist.org/packages/ybagheri/strfun)[ RSS](/packages/ybagheri-strfun/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Strfun
======

[](#strfun)

This is a handy little function to strip out a string between two specified pieces of text. This could be used to parse XML text, bbCode, or any other delimited code/text for that matter. based on justin-cook method.

Usage
-----

[](#usage)

### Install Through Composer

[](#install-through-composer)

```
composer require ybagheri/strfun dev-master

```

Examples
--------

[](#examples)

```
require "vendor/autoload.php";
use Ybagheri\Strfun;

$fullstring = 'this is my [tag]dog[/tag]';

$beforeTag = 'this is my ';
$afterTag = 'dog[/tag]';
$betweenTag = 'dog';

$startTag='[tag]';
$endTag='[/tag]';

echo Strfun::getStringBetween($fullstring, $startTag, $endTag).''; //dog
echo Strfun::getStringBefore($fullstring, $startTag, $endTag).''; //this is my
echo Strfun::getStringAfter($fullstring, $startTag, $endTag).''; //dog[/tag]
//----------------------------------

$mixedText =  '۰۱۲۳456۷۸۹';
echo Strfun::faToEnNumber($mixedText); //'0123456789'
echo PHP_EOL;
echo Strfun::EnTofaNumber($mixedText); //'۰۱۲۳۴۵۶۷۸۹'

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance63

Regular maintenance activity

Popularity12

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/1903666?v=4)[bagheri](/maintainers/bagheri)[@bagheri](https://github.com/bagheri)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/ybagheri-strfun/health.svg)

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

PHPackages © 2026

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