aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2020-01-25 16:24:14 -0800
committerzotlabs <mike@macgirvin.com>2020-01-25 16:24:14 -0800
commitf123809d29d6cc335251cd4fd8984c1b5ef67e2a (patch)
treec8098e8ba3558cbc9fd516b19d64ad055d3a8d71 /include/text.php
parentead56c59e2551f39d00e880a2cdb4b2d02b38705 (diff)
downloadvolse-hubzilla-f123809d29d6cc335251cd4fd8984c1b5ef67e2a.tar.gz
volse-hubzilla-f123809d29d6cc335251cd4fd8984c1b5ef67e2a.tar.bz2
volse-hubzilla-f123809d29d6cc335251cd4fd8984c1b5ef67e2a.zip
more work on zap export
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php15
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);
+}
+