aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-03-30 09:07:43 +0200
committerMario Vavti <mario@mariovavti.com>2018-03-30 09:07:43 +0200
commit6822415ee2efd4e2d3e5458c36cd5f582887969a (patch)
tree30b7aaed9e4d8b56e3a062c95a92d8d276d027b3 /include/text.php
parente06e64823fbecbe67bcf59897ecad6b9c402744e (diff)
parent6d0e1b0e07f26ee07d9f53732daab8ade12566d0 (diff)
downloadvolse-hubzilla-6822415ee2efd4e2d3e5458c36cd5f582887969a.tar.gz
volse-hubzilla-6822415ee2efd4e2d3e5458c36cd5f582887969a.tar.bz2
volse-hubzilla-6822415ee2efd4e2d3e5458c36cd5f582887969a.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/text.php b/include/text.php
index f9cefd020..f634f0d55 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2189,13 +2189,13 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) {
* @returns string
*/
-function array_elm_to_str($arr,$elm,$delim = ',') {
+function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') {
$tmp = [];
if($arr && is_array($arr)) {
foreach($arr as $x) {
if(is_array($x) && array_key_exists($elm,$x)) {
- $z = trim($x[$elm]);
+ $z = $each($x[$elm]);
if(($z) && (! in_array($z,$tmp))) {
$tmp[] = $z;
}
@@ -2205,7 +2205,9 @@ function array_elm_to_str($arr,$elm,$delim = ',') {
return implode($delim,$tmp);
}
-
+function trim_and_unpunify($s) {
+ return unpunify(trim($s));
+}
/**