Docs Goabase

Helper extends HelperFormat
in package

Table of Contents

Methods

calcZipSize()  : int
checkAtts()  : array<string|int, mixed>
setzt (int) auf _id
dateTimeFormat()  : string
translates iso-timestamp into other format YYYY-MM-DD hh:mm:ss uralte funktion
decodeToArray()  : mixed
json to array
doIntRow()  : array<string|int, mixed>
encodeToIso()  : string
encodeToJson()  : string
Returns the json representation of a value
encodeToUtf8()  : string
fetchGeoError()  : string
getCleanIntVal()  : int|float
getPartyTodayHint()  : string
Get "today" or "tomorrow" text for a party date
getRandomString()  : string
Random string
hasAllKeys()  : bool
Helper function to check if all keys exist in the array
htmlSan()  : string
humanFilesize()  : string
isIsoDate()  : bool
Validates the date format YYYY-MM-DD
jsonError()  : void
makeEntityCrapRepair()  : array<string|int, mixed>|string|array<string|int, string>|null
Repairs Entity Crap
makeUcWords()  : string
mbEscape()  : string
Returns a string with backslashes before characters that need to be escaped.
numberFormat()  : float|string
Formats a number/price in the language
returnAlphaNum()  : mixed
Helper preg_replace('/[^0-9A-z]/','',$var)
returnAtoZ()  : string
returnDigit()  : int
Helper preg_replace('/\D/','',$var)
returnPUID()  : string
shortenString()  : string
Kuerzt string nach nLen zeichen und ergaenzt '...'
singlePartyLng()  : string
superTrim()  : string|array<string|int, mixed>
Removes double spaces and line breaks

Methods

calcZipSize()

public static calcZipSize(int $nSizeChars) : int
Parameters
$nSizeChars : int
Return values
int

checkAtts()

setzt (int) auf _id

public static checkAtts([array<string|int, mixed> $saAtt = [] ]) : array<string|int, mixed>
Parameters
$saAtt : array<string|int, mixed> = []
Return values
array<string|int, mixed>

dateTimeFormat()

translates iso-timestamp into other format YYYY-MM-DD hh:mm:ss uralte funktion

public static dateTimeFormat(string $dateTime[, string $dateFormat = '' ]) : string
Parameters
$dateTime : string

timestamp ISO

$dateFormat : string = ''
Return values
string

decodeToArray()

json to array

public static decodeToArray(string $json) : mixed
Parameters
$json : string

doIntRow()

public static doIntRow([array<string|int, mixed> $saRow = [] ]) : array<string|int, mixed>
Parameters
$saRow : array<string|int, mixed> = []
Return values
array<string|int, mixed>

encodeToIso()

public static encodeToIso(string $string) : string
Parameters
$string : string
Return values
string

encodeToJson()

Returns the json representation of a value

public static encodeToJson(mixed $val) : string
Parameters
$val : mixed
Return values
string

encodeToUtf8()

public static encodeToUtf8(string $string) : string
Parameters
$string : string
Return values
string

fetchGeoError()

public static fetchGeoError() : string
Return values
string

getCleanIntVal()

public static getCleanIntVal(mixed $var) : int|float
Parameters
$var : mixed
Return values
int|float

getPartyTodayHint()

Get "today" or "tomorrow" text for a party date

public static getPartyTodayHint(array<string|int, mixed> $saParty) : string
Parameters
$saParty : array<string|int, mixed>
Tags
throws
Exception
Return values
string

getRandomString()

Random string

public static getRandomString([int $length = 32 ][, string $allowed = '' ]) : string
Parameters
$length : int = 32
$allowed : string = ''
Tags
throws
RandomException
Return values
string

hasAllKeys()

Helper function to check if all keys exist in the array

public static hasAllKeys(array<string|int, mixed> $array, array<string|int, mixed> $keys) : bool
Parameters
$array : array<string|int, mixed>
$keys : array<string|int, mixed>
Return values
bool

htmlSan()

public static htmlSan(mixed $var) : string
Parameters
$var : mixed
Return values
string

humanFilesize()

public static humanFilesize(string $bytes[, int $decimals = 2 ]) : string
Parameters
$bytes : string
$decimals : int = 2
Return values
string

isIsoDate()

Validates the date format YYYY-MM-DD

public static isIsoDate(string $date) : bool
Parameters
$date : string
Return values
bool

jsonError()

public static jsonError(int $errorCode, string $errorData) : void
Parameters
$errorCode : int
$errorData : string

makeEntityCrapRepair()

Repairs Entity Crap

public static makeEntityCrapRepair(array<string|int, mixed>|string $strTerm) : array<string|int, mixed>|string|array<string|int, string>|null
Parameters
$strTerm : array<string|int, mixed>|string

"Fovič";

Return values
array<string|int, mixed>|string|array<string|int, string>|null

UTF-8

makeUcWords()

public static makeUcWords(string $str) : string
Parameters
$str : string
Return values
string

mbEscape()

Returns a string with backslashes before characters that need to be escaped.

public static mbEscape(string $string) : string

As required by MySQL and suitable for multi-byte character sets Characters encoded are NUL (ASCII 0), \n, \r, , ', ", and ctrl-Z. In addition, the special control characters % and _ are also escaped, suitable for all statements, but especially suitable for LIKE.

Parameters
$string : string

String to add slashes to

Tags
author

Trevor Herselman

Return values
string

$string with \ prepended to reserved characters

numberFormat()

Formats a number/price in the language

public static numberFormat(float|string $number[, int $decimals = 2 ]) : float|string
Parameters
$number : float|string
$decimals : int = 2
Return values
float|string

returnAlphaNum()

Helper preg_replace('/[^0-9A-z]/','',$var)

public static returnAlphaNum(mixed $var) : mixed
Parameters
$var : mixed

returnAtoZ()

public static returnAtoZ(mixed $var) : string
Parameters
$var : mixed
Return values
string

returnDigit()

Helper preg_replace('/\D/','',$var)

public static returnDigit(mixed $var) : int
Parameters
$var : mixed
Return values
int

returnPUID()

public static returnPUID(mixed $var) : string
Parameters
$var : mixed
Return values
string

shortenString()

Kuerzt string nach nLen zeichen und ergaenzt '...'

public static shortenString(string|null $strVal, int $nLen) : string
Parameters
$strVal : string|null
$nLen : int
Return values
string

singlePartyLng()

public static singlePartyLng(int $nParties) : string
Parameters
$nParties : int
Tags
throws
Exception
Return values
string

superTrim()

Removes double spaces and line breaks

public static superTrim(string|array<string|int, mixed> $strText[, bool $bHtml = false ]) : string|array<string|int, mixed>
Parameters
$strText : string|array<string|int, mixed>
$bHtml : bool = false
  • replaces empty space between tags ...
Return values
string|array<string|int, mixed>

        
On this page

Search results