return floatval($floatString);
}
+/**
+ * Searches a multi-dimensional array (as used in many places) for given
+ * key/value pair as taken from user comments from PHP documentation website.
+ *
+ * @param $array An array with one or more dimensions
+ * @param $key Key to look for
+ * @param $valur Value to look for
+ * @return $results Resulted array or empty array if $array is no array
+ * @author sunelbe<at>gmail<dot>com
+ * @link http://de.php.net/manual/en/function.array-search.php#110120
+ */
+function search_array ($array, $key, $value) {
+ // Init array result
+ $results = array();
+
+ // Is $array really an array?
+ if (is_array($array)) {
+ // Does key and value match?
+ if (isset($array[$key]) && $array[$key] == $value) {
+ // Then add it as result
+ $results[] = $array;
+ } // END - if
+
+ // Search for whole array
+ foreach ($array as $subArray) {
+ // Search recursive and merge again
+ $results = merge_array($results, search_array($subArray, $key, $value));
+ } // END - foreach
+ } // END - if
+
+ // Return resulting array
+ return $results;
+}
+
// Generates a YES/NO option list from given default
function generateYesNoOptions ($defaultValue = '') {
// Generate it