Util

ISPAPI Util

package

ISPAPI

Methods

Encode the command array in a command-string

command_encode(array $commandarray) : string
static

Arguments

$commandarray

array

Command array

Response

string

Encoded command as a string

Returns true if associative array

is_associative(array $arr) : boolean
static

Arguments

$arr

array

An array

Response

boolean

True if associative array

Convert the response string as a hash

response_to_hash(string $response) : array
static

Arguments

$response

string

Response

array

The response as a hash

Convert the response string as a list hash

response_to_list_hash(string $response) : array
static

Arguments

$response

string

Response

array

The response as a list hash

Convert the Unix-Timestamp to a SQL datetime If no timestamp given, returns the current datetime

sqltime(string|int $timestamp = null) : \ISPAPI\datetime
static

Arguments

$timestamp

string|int

A Unix-Timestamp or nothing

Response

\ISPAPI\datetime

The SQL datetime

Convert the SQL datetime to Unix-Timestamp

timesql(\ISPAPI\datetime $sqldatetime) : int
static

Arguments

$sqldatetime

\ISPAPI\datetime

The SQL datetime

Response

int

A Unix-Timestamp

URL-encodes string This function is convenient when encoding a string to be used in a query part of a URL

url_encode(string $string) : string
static

Arguments

$string

string

The string

Response

string

The encoded url string

Decodes URL-encoded string Decodes any %## encoding in the given string.

url_decode(string $string) : string
static

Arguments

$string

string

The encoded URL string

Response

string

The decoded string

Encodes data with MIME base64 This encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean, such as mail bodies.

base64_decode(string $string) : string
static

Arguments

$string

string

The string

Response

string

The encoded base64 string

Decodes data encoded with MIME base64

base64_encode(string $string) : string
static

Arguments

$string

string

The encoded base64 string

Response

string

The decoded string