diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-04-18 08:19:56 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-04-18 08:19:56 +0200 |
commit | 440ccf19d1b21d293f134e03233f0dd564cdc5ba (patch) | |
tree | 752bc8e1210197e2eff3ee8c1cad96bf74ac4a9c /include/text.php | |
parent | c0794a83b490031590bc1488b3f15a0cb4f7a2e4 (diff) | |
parent | fc7d9c235cf845e687095d4f30d32eca4c12bc4a (diff) | |
download | volse-hubzilla-440ccf19d1b21d293f134e03233f0dd564cdc5ba.tar.gz volse-hubzilla-440ccf19d1b21d293f134e03233f0dd564cdc5ba.tar.bz2 volse-hubzilla-440ccf19d1b21d293f134e03233f0dd564cdc5ba.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 13c4bb819..bc44f22f3 100644 --- a/include/text.php +++ b/include/text.php @@ -2324,6 +2324,23 @@ function stringify_array_elms(&$arr, $escape = false) { $arr[$x] = "'" . (($escape) ? dbesc($arr[$x]) : $arr[$x]) . "'"; } + +/** + * @brief Similar to stringify_array_elms but returns a string. If $escape is true, dbesc() each element before adding quotes. + * + * @param array $arr + * @param boolean $escape (optional) default false + * @return string + */ +function stringify_array($arr, $escape = false) { + if($arr) { + stringify_array_elms($arr); + return(implode(',',$arr)); + } + return EMPTY_STR; +} + + /** * @brief Indents a flat JSON string to make it more human-readable. * |