while ($r = mysql_fetch_assoc($rs)) {
$arr[] = $r;
}
- } elseif (is_numeric($key)) {
+ } elseif ((string)intval($key)===(string)$key) {
while ($r = mysql_fetch_row($rs)) {
$arr[$r[$key]] = $r;
}
return $text;
}
+function array_prepend_keys($lst, $pre) {
+ if (is_array($lst) && count($lst) && is_string($pre)) {
+ $rlst = array_combine(array_map(create_function('$a','return "'.$pre.'$a";'),array_keys($lst)),$lst);
+ if (is_array($rlst) && count($rlst)) {
+ return $rlst;
+ }
+ }
+ return $lst;
+}
+
?>