\AppBundle\TraitsFormatsTrait

Trait FormatsTrait - Some useful functions

Summary

Methods
Properties
Constants
left()
right()
intrim()
getmin()
rem_right()
trim_element()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

left()

left(string  $str, integer  $numchars) : boolean|string

Returns the first $numchars characters of a string.

Parameters

string $str
integer $numchars

Returns

boolean|string

right()

right(string  $str, integer  $numchars) : boolean|string

Returns the substring beginning at $numchars characters from the right end of a string.

Parameters

string $str
integer $numchars

Returns

boolean|string

intrim()

intrim(string  $string) : mixed

Removes "internal spaces" (as opposed to leading and trailing spaces) from a string.

Parameters

string $string

Returns

mixed

getmin()

getmin(integer  $x, integer  $y, integer  $z) : integer

Gets the minimum of three (usually numeric) values $x, $y, and $z.

For now, this can't handle situations when one or more arguments is FALSE.

Parameters

integer $x
integer $y
integer $z

Returns

integer

rem_right()

rem_right(string  $str, integer  $charcount = 1) : boolean|string

Removes $charcount characters from the right (end) of a string.

Parameters

string $str
integer $charcount

Returns

boolean|string

trim_element()

trim_element(  $value,   $key) 

trim_element() removes leading and trailing spaces from a string. In conjunction with the array_walk() function, it removes spaces from each element of an array.

Parameters

$value
$key