Phpxforms documentation

Utils
in package

Support class for filename extension and unit conversion

Table of Contents

Methods

getExt()  : string
Get file extension
getIcon()  : string
Get fontawesome icon based on file extension
getMaxUpload()  : int
Get maximum upload size
numToSize()  : array{: float, : string}|string
Convert numeric value to KB
sizeToNum()  : int
Convert KB to number
sortByDate()  : int
Sort files by date
sortByName()  : int
Sort files by name
sortBySize()  : int
Sort files by size

Methods

getExt()

Get file extension

public static getExt(string $name) : string
Parameters
$name : string
Return values
string

getIcon()

Get fontawesome icon based on file extension

public static getIcon(string $ext) : string
Parameters
$ext : string
Return values
string

getMaxUpload()

Get maximum upload size

public static getMaxUpload([int $custom = 0 ]) : int
Parameters
$custom : int = 0
Return values
int

numToSize()

Convert numeric value to KB

public static numToSize(int $num[, bool $split = false ]) : array{: float, : string}|string
Parameters
$num : int
$split : bool = false
Return values
array{: float, : string}|string

sizeToNum()

Convert KB to number

public static sizeToNum(string $val) : int
Parameters
$val : string
Return values
int

sortByDate()

Sort files by date

public static sortByDate(array<string, string> $a, array<string, string> $b) : int
Parameters
$a : array<string, string>
$b : array<string, string>
Return values
int

sortByName()

Sort files by name

public static sortByName(array<string, string> $a, array<string, string> $b) : int
Parameters
$a : array<string, string>
$b : array<string, string>
Return values
int

sortBySize()

Sort files by size

public static sortBySize(array<string, int> $a, array<string, int> $b) : int
Parameters
$a : array<string, int>
$b : array<string, int>
Return values
int

        
On this page

Search results