Magrathea PHP 2

MagratheaHelper
in package

Table of Contents

Methods

EnsureTrailingSlash()  : string
ensure there's a slash in the end of string
HexToRgb()  : array<string|int, mixed>
Converts HEXrgb to DECrgb (#CB8008) to [r:203, g:128, b:8]
RandomString()  : string
Generates a random string

Methods

EnsureTrailingSlash()

ensure there's a slash in the end of string

public static EnsureTrailingSlash(string $str) : string
Parameters
$str : string

string with or without slash

Return values
string

string with slash in the end, for sure

HexToRgb()

Converts HEXrgb to DECrgb (#CB8008) to [r:203, g:128, b:8]

public HexToRgb(mixed $hex) : array<string|int, mixed>
Parameters
$hex : mixed
Return values
array<string|int, mixed>

decimal color as [r, g, b]

RandomString()

Generates a random string

public static RandomString([int $length = 10 ]) : string
Parameters
$length : int = 10

size of string

Return values
string

random string


        
On this page

Search results