- Added a parameter in API->delete() to optionally stop the running of API->set_existing() [api.php]
- Changed some of the API error messages to reflect what actually caused the error [api.php]
- Made the Printer->row_text() colspan parameter work more normally [printer.php]
+- Added Functions->array_strip_empty() to strip empty and null elements from a given array [functions.php]
2.0.0
===============
$text = str_replace("\n", $convert_to, $text);
return $text;
}
+
+ // ###################################################################
+ /**
+ * Removes all empty() [by PHP's standards] elements in an array. This
+ * can be used in place of using PREG_SPLIT_NO_EMPTY.
+ *
+ * @access public
+ *
+ * @param array An array to strip empties from
+ *
+ * @return array Full-valued array
+ */
+ function array_strip_empty($array)
+ {
+ foreach ($array AS $key => $value)
+ {
+ if (is_array($array["$key"]))
+ {
+ $array["$key"] = $this->array_strip_empty($array["$key"]);
+ }
+ else if (empty($value) OR is_null($value))
+ {
+ unset($array["$key"]);
+ }
+ }
+ return $array;
+ }
}
/*=====================================================================*\