\Amelaye\BioPHP\Domain\Sequence\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, 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( $value,  $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

$value
$key

Returns

mixed