summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class5
1 files changed, 5 insertions, 0 deletions
diff --git a/it.class b/it.class
index aa12435..6fc2d9c 100644
--- a/it.class
+++ b/it.class
@@ -643,6 +643,11 @@ function date($format = "", $stamp = null)
return date($formatstring, $stamp);
}
+/**
+ * Iterate over an array, replacing every element by expression
+ * @param $expr The expression to apply, may contain $k for keys and $v for values
+ * @param $arr The array to iterate over
+ */
function map($expr, $arr)
{
$func = create_function('$k,$v', "return $expr;");