minor code optimisation
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user