Berserker bStrings Class

Berserker bStrings Class is made to simulate a package for the native string functions of PHP.

Before continue, let’s understand that Berserker offer you 2 ways of using classes, or a better approach is to say that offer you 2 Classes per package and you have to select what approach you want to use in the entire project static classes or instantiated method.

in the static las you will simulate the package with:

bStrings::

in instantiated, you will simulate the package with:

bStrings->

You can check how to select the aproach you want in https://blastcoding.com/en/php-berserker/

Let’s check what bStrings offers you for now:

subString

subString – uses PHP substr, the description is as follows in both approaches

subString(string $text,string $offset,int $length= null):string

trimBoth and trim

trimBoth- uses PHP trim

trimBoth(string $str, string $character_mask = ” \t\n\r\0\x0B”): string

trimLeft

trimLeft – uses PHP ltrim

trimRight

– uses PHP rtrim

htmlEntities

– uses PHP htmlentities

htmlSpecialChars

– uses PHP htmlspecialchars

stripTags

– uses PHP strip_tags

addSlashes

– uses PHP addslashes

implode

– uses PHP implode

explode

– uses PHP explode

chopFromString

– uses PHP strstr

findFirstPosition

– uses PHP stripos

contains

– uses PHP str_contains

length

– uses PHP strlen

binToHex

– uses PHP bin2Hex

cvsToArray

– uses PHP str_getcsv

uppercase

– uses PHP strtoupper

lowercase

– uses PHP strtolower

replace

CRC32

echo

hebrev

hexToBin

lowercase1stCar

levenshtein

localConversion

numFormat

similarities

parseWithFormat

decrement

isEndedWith

increment

isStartedWith

stripSlashes

naturalOCompare

compareCaseIgnore

compare

reverse