diff options
author | Zot <mike@macgirvin.com> | 2020-01-30 20:06:15 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-01-30 20:06:15 +0100 |
commit | 2c42daf6090ba8d0e3a50b8350ea5a3750891b68 (patch) | |
tree | 112a577d708088aecabd8af957c5c40b8e24e313 /include/text.php | |
parent | 8e2446a2fc706a6750c925b4c2672314be6bb91f (diff) | |
download | volse-hubzilla-2c42daf6090ba8d0e3a50b8350ea5a3750891b68.tar.gz volse-hubzilla-2c42daf6090ba8d0e3a50b8350ea5a3750891b68.tar.bz2 volse-hubzilla-2c42daf6090ba8d0e3a50b8350ea5a3750891b68.zip |
z6 compat work
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 87ed9f658..1f0af08e3 100644 --- a/include/text.php +++ b/include/text.php @@ -3694,3 +3694,18 @@ function svg2bb($s) { } return EMPTY_STR; } + + + +function serialise($x) { + return ((is_array($x)) ? 'json:' . json_encode($x) : $x); +} + +function unserialise($x) { + if (is_array($x)) { + return $x; + } + $y = ((substr($x,0,5) === 'json:') ? json_decode(substr($x,5),true) : ''); + return ((is_array($y)) ? $y : $x); +} + |