karls / helper
This is a package for karls!!!
- dev-master
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- dev-other/klp-70-move-qlik-api-lib-from-pib-into-klp-package
- dev-bug/klp-42-response-duplicate
- dev-feature/KLP-41-helper---codemessage-erstellen
- dev-KLP-23-array-functions-test---helper
- dev-feature/KLP-22-add-array_mask-array_without-to-h
- dev-other/klp-20-tests-für-core-package
- dev-KLP-2-readme-ausformulieren
This package is auto-updated.
Last update: 2025-03-24 12:51:21 UTC
README
These functions are helper functions for our company.
germanDatetime()
(string $dateString, bool $strict = true): string
This function transforms any given string which contains date information to a valid german datetime.
string $dateString
This is the date string which has to be converted.
bool $strict = true
This boolean decides if there should be an exception, or an empty string as return value.
return string | Exception
In case of invalid data there will be an exception or an empty string in non-strict mode.
Example
result: 01.12.2022 09:00
($dateString = 2022-12-01 09:00, $strict = true)
generateRandomString
(int $length = 30, bool $errorProtected = false): string
This function generates a random string with specific length and if needed error protected. This means, all ambiguous chars aren't included.
int $length = 30
The wanted length of the generated string.
bool $errorProtectes = false
This bool decides if there has no ambiguous chars in the random string.
return string | Exception
In case of invalid data there will be an exception.
Example
result: "4A65ushf4HzIUrw"
>($length = 15 && $errorProtected = false)
calcPeriod
(int $period): array
This function calculates the years and months of a given month amount.
int $period
The amount of months to calculate with.
return array
This array consists of the amount of years and months calculated as numeric array [year, month].
Example
result: [4,11]
($period = 59)