You are here:  » Issue where fields are optional

Issue where fields are optional

Submitted by I-CRE8 on Mon, 2023-11-06 17:23 in

I have a situation where the xml file I am receiving has optional fields which is throwing the data out, for example when I print_r $record for this part of the xml file this is what is returned

{code saved}

As you will see the count is wrong when the previous [MARKETING_COPY/IMAGE_FEATURES/IMAGE_FEATURE] section is missing one of the optional fields. Is there a way to loop through the [MARKETING_COPY/IMAGE_FEATURES/IMAGE_FEATURE] sections so that I can insert only the fields present ?