Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // loop through complex multi inputs like address, name and checkboxes
- // Help Scout 29847
- // http://pastie.org/8295603
- $values= array();
- foreach( $form['fields'] as $field ) {
- if(isset($field["inputs"])){
- $input_value = array();
- foreach($field["inputs"] as $input){
- $input_value[] = $lead[$input["id"]];
- }
- $field_value = implode(" ", $input_value);
- }
- else{
- $field_value = $lead[ $field['id'] ];
- }
- $values[$field['id']] = array(
- 'id' => $field['id'],
- 'label' => $field['label'],
- 'value' => $field_value
- );
- }
- print_r($values)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement