" <?php if (in_array($key, is_array($data[$field['name']]) ? $data[$field['name']] : explode(',', $data[$field['name']]))) { ?> checked="checked"<?php } ?> > <label for="<?php echo $field["name"]; ?> _<?php echo $key; ?> "></label><?php echo clean_hide_attr($vo); ?> </div><?php } } } else { echo ""; } break; ?> <?php case "editor": ?> <label class="textarea"> <textarea name="<?php
function parse_field_attr($string) { if (0 === strpos($string, ':')) { // 采用函数定义 return eval(substr($string, 1) . ';'); } $array = preg_split('/[;\\r\\n]+/', trim($string, ",;\r\n")); // dump($array); if (strpos($string, ':')) { $value = array(); foreach ($array as $val) { list($k, $v) = explode(':', $val); empty($v) && ($v = $k); $k = clean_hide_attr($k); $value[$k] = $v; } } else { $value = $array; } // dump($value); return $value; }