2017 © Pedro Peláez
 

library 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

image

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

  • Tuesday, March 6, 2018
  • by bagheri
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 53 % Grown

The README.md

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., (*1)

Usage

Install Through Composer

composer require ybagheri/strfun dev-master

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).'</br>'; //dog
echo Strfun::getStringBefore($fullstring, $startTag, $endTag).'</br>'; //this is my
echo Strfun::getStringAfter($fullstring, $startTag, $endTag).'</br>'; //dog[/tag]
//----------------------------------

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



The Versions

06/03 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Yousef Bagheri

utf-8 convert string numbers persian ascii arabic english character farsi converting between iso-8859-1