\GSPPanel\Strings
Methods
ByteSize(integer $size) : stringConverts bytes into KB, MB, GB and returns the value
| Name | Type | Description |
|---|---|---|
| $size | integer |
| Type | Description |
|---|---|
| string |
CheckBlacklist(string $type, string $value) : booleanChecks the blacklist for the specified item
| Name | Type | Description |
|---|---|---|
| $type | string | The blacklist type to search for |
| $value | string | The value to search for in the blacklist |
| Type | Description |
|---|---|
| boolean | true|false If there was a match found |
EndsWith( $FullStr, $EndStr) : voidChecks if the end of a string contains certain text
| Name | Type | Description |
|---|---|---|
| $FullStr | ||
| $EndStr |
- Access
- private
GameReplaceVars(array $params) : arrayReplaces GSP-Panel variables with the correct game variables
$params requires the following;
- ugid: The users gameserver id
- content: The content that needs variables replaced
Returns the following:
- error
- -1: No usergame specified
- 0: Success
- content: The new content with replaced variables
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| array |
ReplaceVars(array $params) : arrayReplaces GSP-Panel variables with the correct user profile or setting variables
$params requires the following;
- uid: The users id
- content: The content that needs variables replaced
Returns the following:
- error
- -1: No user id specified
- -2: No user found matching the specified user id
- 0: Success
- content: The new content with replaced variables
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| array |
array2ini(array $array) : stringConverts an array to an ini
| Name | Type | Description |
|---|---|---|
| $array | array |
| Type | Description |
|---|---|
| string |
createRandomPassword() : stringReturns a random password
| Type | Description |
|---|---|
| string |
filter_xml( $matches) : void| Name | Type | Description |
|---|---|---|
| $matches |
parse_ini_string(string $str, boolean $ProcessSections = false) : arrayConverts an ini to an array
| Name | Type | Description |
|---|---|---|
| $str | string | The ini contents |
| $ProcessSections | boolean | Seperate the array into sections |
| Type | Description |
|---|---|
| array |
search_array(string $needle, array $array, string $item) : stringAllows multi-dimensional array search using the specified key
| Name | Type | Description |
|---|---|---|
| $needle | string | The value to search for |
| $array | array | The array to search in |
| $item | string | The key to look for needle in |
| Type | Description |
|---|---|
| string | Returns -1 if nothing was found or returns the key |
str_replace_last( $search, $replace, $subject) : voidReplaces the last string and returns the new contents
| Name | Type | Description |
|---|---|---|
| $search | ||
| $replace | ||
| $subject |
- Access
- private
version_compare2( $version1, $version2) : voidCompare two versions
| Name | Type | Description |
|---|---|---|
| $version1 | ||
| $version2 |
- Access
- private
xml2array( $xml) : voidConverts an XML string to an array
| Name | Type | Description |
|---|---|---|
| $xml |
xml_to_array( $xml, $main_heading = '') : voidConverts an XML string to an array
| Name | Type | Description |
|---|---|---|
| $xml | ||
| $main_heading |