I have a database in .csv format. To retrieve data, I used a csv parser from where I got the result in array as
Array
(
[fieldset_name] => Personal Details
[field_name] => applicant_name
[field_label] => Your Name
[field_type] => text
[css_classes] => required
[minlength] => 4
[maxlength] => 10
[default_value] =>
[help_text] =>
)
Array
(
[fieldset_name] => Personal Details
[field_name] => applicant_address
[field_label] => Address
[field_type] => textarea
[css_classes] => required
[minlength] => 4
[maxlength] => 10
[default_value] =>
[help_text] =>
)
Now I used this code for making this array as like a html form
<?php foreach ( $form_field as $key => $v1 ) {
$fieldset_name = $v1['fieldset_name'];
$field_name = $v1['field_name'];
$field_label = $v1['field_label'];
$field_type = $v1['field_type'];
$css_classes = $v1['css_classes'];
$minlength = $v1['minlength'];
$maxlength = $v1['maxlength'];
$default_value = $v1['default_value'];
<label for "<?php echo $field_name; ?>"></label><?php echo $field_label; ?><input type="<?php echo $field_type;?>" id = "<?php echo $css_classes; ?>"/>
<?php }
From where I got the result as
<label for "applicant_name"></label>Your Name<input type="text" id = "required"/>
<label for "city"></label>City<input type="text" id = "required"/>
Now I want to set the for both values. For first I want to set the value like.
<legend>Your Name</legend>
<label for "applicant_name"></label>Your Name<input type="text" id = "required"/>
<legend>Address</legend>
<label for "city"></label>City<input type="text" id = "required"/>
So please tell me how to do this in foreach loop or in if..else condition as I have a big form like this so I can't set the value manually.