From 7ca07ec31aff430af66b5b46b361c8fc8df0bb0a Mon Sep 17 00:00:00 2001 From: Dotan Cohen Date: Wed, 17 Jul 2013 19:11:50 +0300 Subject: [PATCH] Move HTML to a separate file. --- html.php | 33 +++++++++++++++++++++++++++++++++ util.php | 28 ---------------------------- 2 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 html.php diff --git a/html.php b/html.php new file mode 100644 index 0000000..2f578e6 --- /dev/null +++ b/html.php @@ -0,0 +1,33 @@ + of a select statement and optionally preselect one +* +* @author Dotan Cohen +* @version 2013-06-30 +* +* @param array $data Associative array to be converted to +* @param string $quote_char Character to use to quote values. Must be " or ' +* @param string $selected Default value to select +* +* @return TRUE +*/ +function output_select_options($data, $quote_char='"', $selected=NULL) +{ + if ( !is_array($data) || !in_array($quote_char, array('"', "'")) ) { + return NULL; + } + + foreach ( $data as $f=>$v) { + $s = $f==$selected ? " selected={$quote_char}selected{$quote_char}" : ''; + echo ""; + } + + return TRUE; +} + + + +?> diff --git a/util.php b/util.php index 5002050..337da4d 100644 --- a/util.php +++ b/util.php @@ -238,32 +238,4 @@ function get_typical_results($input) -/** -* Output the of a select statement and optionally preselect one -* -* @author Dotan Cohen -* @version 2013-06-30 -* -* @param array $data Associative array to be converted to -* @param string $quote_char Character to use to quote values. Must be " or ' -* @param string $selected Default value to select -* -* @return TRUE -*/ -function output_select_options($data, $quote_char='"', $selected=NULL) -{ - if ( !is_array($data) || !in_array($quote_char, array('"', "'")) ) { - return NULL; - } - - foreach ( $data as $f=>$v) { - $s = $f==$selected ? " selected={$quote_char}selected{$quote_char}" : ''; - echo ""; - } - - return TRUE; -} - - - ?>