aboutsummaryrefslogtreecommitdiffstats
path: root/php/helpers.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/helpers.php')
-rw-r--r--php/helpers.php13
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;
+}
+