Documentation

Utils
in package

Common utilities

Table of Contents

isBot()  : bool
Method returns true if any bot was detected
mbStrTr()  : string
Simple transliterator
translit()  : string
Method translits string
translitUrl()  : string
Method translits string into URL I.e.
getTranslitDictionary()  : array<string|int, string>
Method returns translit dictionary
mbStrSplit()  : array<string|int, string>
Method splits multybyte string into chars
mbStrTrArray()  : string
Simple transliterator

Methods

isBot()

Method returns true if any bot was detected

public static isBot(string $userAgent) : bool
Parameters
$userAgent : string

Visitor's user agent

Return values
bool

True|false

mbStrTr()

Simple transliterator

public static mbStrTr(string $str, string $from, string $to) : string
Parameters
$str : string

string to translit

$from : string

origin sybmols

$to : string

target symbols

Return values
string

translitted string

translit()

Method translits string

public static translit(string $text) : string
Parameters
$text : string

string to be translitted

Return values
string

translitted string

translitUrl()

Method translits string into URL I.e.

public static translitUrl(string $text) : string

all spaces will be replaced in '-'

Parameters
$text : string

string to be translitted

Return values
string

translitted string

getTranslitDictionary()

Method returns translit dictionary

private static getTranslitDictionary() : array<string|int, string>
Return values
array<string|int, string>

translit dictionary

mbStrSplit()

Method splits multybyte string into chars

private static mbStrSplit(string $str) : array<string|int, string>
Parameters
$str : string

string tobe splitted

Return values
array<string|int, string>

chars

mbStrTrArray()

Simple transliterator

private static mbStrTrArray(string $str, array<string|int, string> $substitution) : string
Parameters
$str : string

string to translit

$substitution : array<string|int, string>

substitutions in key+value pairs

Return values
string

translitted string

Search results

    Яндекс.Метрика