HelperFormat
extends HelperJson
in package
Table of Contents
Methods
- calcZipSize() : int
- checkAtts() : array<string|int, mixed>
- setzt (int) auf _id
- cleanComment() : array<string|int, mixed>|string
- Helper preg_replace Returns text/code without comments
- cleanNum() : mixed
- Cuts zeros at the end
- cleanWWW() : string
- Removes https://, https://www., http://, http://www., www.
- 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
- filledOnly() : array<string|int, mixed>
- filterAllowedCsvValues() : string
- Values können einfach oder mehrfach kommagetrennt sein. Die gültigen müssen am Ende der Liste stehen.
- getAllowedAtt() : array<string|int, mixed>
- getApostroph() : string
- Setzt Apostroph
- getCleanIntVal() : int|float
- getFileToSeo() : string
- getFontOfSmiley() : string
- converts ascii-smileys to
- getPartyTodayHint() : string
- Get "today" or "tomorrow" text for a party date
- getRandom() : int
- 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
- makeEntityCrapRepair() : array<string|int, mixed>|string|array<string|int, string>|null
- Repairs Entity Crap
- numberFormat() : float|string
- Formats a number/price in the language
- removeTitleRe() : string
- Removes the "Re: " from the forum title
- replaceName() : string
- returnAlphaNum() : int|string|null
- Helper preg_replace('/[^0-9A-z]/','',$var)
- returnAtoZ() : string
- returnDigit() : int
- Helper preg_replace('/\D/','',$var)
- returnPUID() : string
- singlePartyLng() : string
- userName() : string
Methods
calcZipSize()
public
static calcZipSize(int $nSizeChars) : int
Parameters
- $nSizeChars : int
Return values
intcheckAtts()
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>cleanComment()
Helper preg_replace Returns text/code without comments
public
static cleanComment(array<string|int, mixed>|string $var) : array<string|int, mixed>|string
Parameters
- $var : array<string|int, mixed>|string
Return values
array<string|int, mixed>|stringcleanNum()
Cuts zeros at the end
public
static cleanNum(mixed $num) : mixed
Parameters
- $num : mixed
cleanWWW()
Removes https://, https://www., http://, http://www., www.
public
static cleanWWW(string $val) : string
Parameters
- $val : string
Return values
stringdateTimeFormat()
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
stringdecodeToArray()
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
stringencodeToJson()
Returns the json representation of a value
public
static encodeToJson(array<string|int, array<string|int, mixed>|int|mixed|string> $val) : string
Parameters
- $val : array<string|int, array<string|int, mixed>|int|mixed|string>
Tags
Return values
stringencodeToUtf8()
public
static encodeToUtf8(string $string) : string
Parameters
- $string : string
Return values
stringfetchGeoError()
public
static fetchGeoError() : string
Return values
stringfilledOnly()
public
static filledOnly([array<string|int, mixed> $array = [] ]) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed> = []
Return values
array<string|int, mixed>filterAllowedCsvValues()
Values können einfach oder mehrfach kommagetrennt sein. Die gültigen müssen am Ende der Liste stehen.
public
static filterAllowedCsvValues(string $value, string $allowedCsv) : string
Parameters
- $value : string
- $allowedCsv : string
Return values
stringgetAllowedAtt()
public
static getAllowedAtt([array<string|int, mixed> $saAtt = [] ][, string $type = 'party' ]) : array<string|int, mixed>
Parameters
- $saAtt : array<string|int, mixed> = []
- $type : string = 'party'
Return values
array<string|int, mixed>getApostroph()
Setzt Apostroph
public
static getApostroph(string $strName) : string
Parameters
- $strName : string
Return values
stringgetCleanIntVal()
public
static getCleanIntVal(mixed $var) : int|float
Parameters
- $var : mixed
Return values
int|floatgetFileToSeo()
public
static getFileToSeo([string $fileName = THIS_FILE ]) : string
Parameters
- $fileName : string = THIS_FILE
Return values
stringgetFontOfSmiley()
converts ascii-smileys to
public
static getFontOfSmiley(string $strContent[, bool $bFull = false ]) : string
Parameters
- $strContent : string
- $bFull : bool = false
Return values
string —- with emoticons
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>
Return values
stringgetRandom()
public
static getRandom(int $nMin, int $nMax) : int
Parameters
- $nMin : int
- $nMax : int
Return values
inthasAllKeys()
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
boolhtmlSan()
public
static htmlSan(mixed $var) : string
Parameters
- $var : mixed
Return values
stringhumanFilesize()
public
static humanFilesize(string $bytes[, int $decimals = 2 ]) : string
Parameters
- $bytes : string
- $decimals : int = 2
Return values
stringisIsoDate()
Validates the date format YYYY-MM-DD
public
static isIsoDate(string $date) : bool
Parameters
- $date : string
Return values
boolmakeEntityCrapRepair()
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
numberFormat()
Formats a number/price in the language
public
static numberFormat(float|string|int $number[, int $decimals = 2 ]) : float|string
Parameters
- $number : float|string|int
- $decimals : int = 2
Return values
float|stringremoveTitleRe()
Removes the "Re: " from the forum title
public
static removeTitleRe([string $strTitle = '' ]) : string
Parameters
- $strTitle : string = ''
Return values
stringreplaceName()
public
static replaceName([string $strName = '' ][, string $strContent = '' ]) : string
Parameters
- $strName : string = ''
- $strContent : string = ''
Return values
stringreturnAlphaNum()
Helper preg_replace('/[^0-9A-z]/','',$var)
public
static returnAlphaNum([mixed $var = '' ]) : int|string|null
Parameters
- $var : mixed = ''
Return values
int|string|nullreturnAtoZ()
public
static returnAtoZ(string $var) : string
Parameters
- $var : string
Return values
stringreturnDigit()
Helper preg_replace('/\D/','',$var)
public
static returnDigit(mixed $var) : int
Parameters
- $var : mixed
Return values
intreturnPUID()
public
static returnPUID(int|string $var) : string
Parameters
- $var : int|string
Tags
Return values
stringsinglePartyLng()
public
static singlePartyLng(int $nParties) : string
Parameters
- $nParties : int
Return values
stringuserName()
public
static userName(string|null $strUserPublicName, string $strTopic) : string
Parameters
- $strUserPublicName : string|null
- $strTopic : string