0

Hi I am using codeigniter and sheepIt clone forms.(embed forms).

I am trying to insert the data into database after submitting.

The output data is in this format when i used print_r()

Array
(
[project] => Array
    (
        [0] => Array
            (
                [module] => Design
                [features] => Array
                    (
                        [feature_0] => Array
                            (
                                [feature] => Login
                                [Hours] => 10
                            )

                        [feature_1] => Array
                            (
                                [feature] => Signup
                                [Hours] => 10
                            )

                    )

            )

        [1] => Array
            (
                [module] => Development
                [features] => Array
                    (
                        [feature_0] => Array
                            (
                                [feature] => Login
                                [Hours] => 20
                            )

                    )

            )

    )

[submit] => save
)

I can post the code of sheepIt forms also.

0

1 Answer 1

1

ANSWER:

$arr_data = $this->input->post();

foreach($arr_data['project'] as $prj) {
    foreach($prj as $i) {
        $arr['module'][] = module = $i['module'];
        foreach($i['features'] as $f) {
            $arr['feature'][] = $f['feature'];
            $arr['Hours'][] = $f['Hours'];
        }
    }
}
print_r($arr);

Use this processed $arr data for storing or other.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.