From 2f139f65da2e400350031bdbbeb44aa7ceeb66d8 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 18 Mar 2008 14:40:15 +0000 Subject: [PATCH] Helper function for searching indexed submit POST vars --- includes/ui/ui_input.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 0831e610..2a51d80f 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -1,5 +1,25 @@ $postval ) { + if (strpos($postkey, $prefix) === 0) { + $id = substr($postkey, strlen($prefix)); + return $numeric ? (int)$id : $id; + } + } + return $numeric ? -1 : null; +} + +//------------------------------------------------------------------------------ +// +// Read numeric value from user formatted input +// function input_num($postname=null) { if (!isset($_POST[$postname])) return null; -- 2.30.2