aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-02-23 09:51:37 +0000
committerMario <mario@mariovavti.com>2023-02-23 09:51:37 +0000
commitefcda1d37d609677b4fdc6a12c63feea250a3f5e (patch)
tree458fd20008007682e804c6141a8225a9cc7f8642 /include/text.php
parent656400b4186a3d6529d47765d5101b7d2f982087 (diff)
downloadvolse-hubzilla-efcda1d37d609677b4fdc6a12c63feea250a3f5e.tar.gz
volse-hubzilla-efcda1d37d609677b4fdc6a12c63feea250a3f5e.tar.bz2
volse-hubzilla-efcda1d37d609677b4fdc6a12c63feea250a3f5e.zip
port some functions from streams
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index a09d1bd7b..d7ffa5550 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3505,6 +3505,14 @@ function flatten_array_recursive($arr) {
return($ret);
}
+// Turn $element into an array if it isn't already.
+function force_array($element) {
+ if (empty($element)) {
+ return [];
+ }
+ return (is_array($element)) ? $element : [$element];
+}
+
/**
* @brief Highlight Text.
*