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
                            )

                   )

            )

    )
Johanna
  • 147
  • 1
  • 10

1 Answers1

3

Try this:

foreach ($your_object->DataFormItem->Values->fv as $fv_element) {
    echo $fv_element->Value." ".$fv_element->ID."<br>";
}
gmc
  • 3,910
  • 2
  • 31
  • 44