1

I am accessing this data via soap and wsdl, finally have the connection returning data. However, I am getting stuck trying to properly access the values in the fv array. What is the proper way to loop through and access them?

   stdClass Object
 (
       [DataFormItem] => stdClass Object
    (
        [Values] => stdClass Object
            (
                [fv] => Array
                    (
                        [0] => stdClass Object
                            (
                                [Value] => xxxx
                                [ID] => FIRSTNAME
                            )

                        [1] => stdClass Object
                            (
                                [Value] => xxxx
                                [ID] => LASTNAME
                            )

                        [2] => stdClass Object
                            (
                                [Value] => xxxx
                                [ID] => BIRTHDATE
                            )

                        [3] => stdClass Object
                            (
                                [Value] => xxxx
                                [ID] => DEGREEYEAR
                            )

                        [4] => stdClass Object
                            (
                                [Value] => xxxx
                                [ID] => ADDRESSBLOCK
                            )

                        [5] => stdClass Object
                            (
                                [Value] => xxxx
                                [ID] => CITY
                            )

                   )

            )

    )
4
  • can you output with var_dump? Commented Mar 30, 2017 at 22:58
  • Sure! I'm driving home, I'll pop back on once there and give you the output. Commented Mar 30, 2017 at 22:59
  • stackoverflow.com/questions/19495068/… Commented Mar 30, 2017 at 23:01
  • @sumit thanks for the ... Commented Mar 30, 2017 at 23:03

1 Answer 1

3

Try this:

foreach ($your_object->DataFormItem->Values->fv as $fv_element) {
    echo $fv_element->Value." ".$fv_element->ID."<br>";
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.