diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2023-03-26 18:31:50 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2023-03-26 18:31:50 +0200 |
| commit | 5aa7c4f9499135dd12162045e441f5215ee050aa (patch) | |
| tree | 4f95f9f2daedb0053a0b6a95a8e354d76b3c115d /php/helpers.php | |
| download | calendrier-menstruel-5aa7c4f9499135dd12162045e441f5215ee050aa.tar.gz calendrier-menstruel-5aa7c4f9499135dd12162045e441f5215ee050aa.tar.zst calendrier-menstruel-5aa7c4f9499135dd12162045e441f5215ee050aa.zip | |
Full working app
Diffstat (limited to 'php/helpers.php')
| -rw-r--r-- | php/helpers.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/php/helpers.php b/php/helpers.php new file mode 100644 index 0000000..cf97ed1 --- /dev/null +++ b/php/helpers.php @@ -0,0 +1,13 @@ +<?php +function toPl(string $str): string +{ + return mb_convert_encoding($str, 'ISO-8859-2', 'UTF-8'); +} +function nullOrData(array $array, int|string $key, mixed $default = NULL): mixed +{ + if (array_key_exists($key, $array)) { + return $array[$key]; + } + return $default; +} + |
