Documentation

HelperFunctions
in package

Various handy helper functions

Table of Contents

$loadUrlError  : mixed
loadUrl()  : string
Load content of remote URL using PHP's CURL library.
minifyHtml()  : string
Minifies HTML
randomPassword()  : string
Generates random password
rmdiacritic()  : string
Removes punctuation characters from string
rmspecialchars()  : string
Removes special characters from string
str2uid()  : mixed
str2url()  : string
Convert string with to URL-compatible string

Properties

Methods

loadUrl()

Load content of remote URL using PHP's CURL library.

public static loadUrl(string $url[, array<string|int, mixed> $post = [] ]) : string
Parameters
$url : string

URL to be loaded

$post : array<string|int, mixed> = []

Array of POST values to be posted to the request

Return values
string

Loaded content of remote URL

minifyHtml()

Minifies HTML

public static minifyHtml(string $html) : string
Parameters
$html : string

Input HTML

Return values
string

Minified HTML

randomPassword()

Generates random password

public static randomPassword() : string
Return values
string

Generated random password

rmdiacritic()

Removes punctuation characters from string

public static rmdiacritic(string $string) : string
Parameters
$string : string

Original string

Return values
string

String with removed punctuation characters

rmspecialchars()

Removes special characters from string

public static rmspecialchars(string $string) : string
Parameters
$string : string

Original string

Return values
string

String with removed special characters

str2uid()

public static str2uid(mixed $string[, mixed $replaceSlashes = TRUE ]) : mixed
Parameters
$string : mixed
$replaceSlashes : mixed = TRUE
Return values
mixed

str2url()

Convert string with to URL-compatible string

public static str2url(string $string[, bool $replaceSlashes = TRUE ]) : string
Parameters
$string : string

Original string

$replaceSlashes : bool = TRUE

If TRUE, slashes are replaced with hyphenation

Return values
string

URL-compatible string

Search results