\Amelaye\BioPHP\Domain\Sequence\Traits FormatsTrait

Trait FormatsTrait - Some useful functions

Summary

Methods
Properties
Constants
left
right
intrim
getmin
rem_right
trim_element
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Methods

left()

left(string  $str, int  $numchars) : bool|string

Returns the first $numchars characters of a string.

Parameters

string $str
int $numchars

Returns

bool|string —

right()

right(string  $str, int  $numchars) : bool|string

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

Parameters

string $str
int $numchars

Returns

bool|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(int  $x, int  $y, int  $z) : int

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

int $x
int $y
int $z

Returns

int —

rem_right()

rem_right(string  $str, int  $charcount = 1) : bool|string

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

Parameters

string $str
int $charcount

Returns

bool|string —

trim_element()

trim_element(mixed  $value, mixed  $key) : mixed

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

mixed $value
mixed $key

Returns

mixed —