Skip to content
Advertisement

How to iterate trhough Facebook LeadAd Array in PHP?

I do Facebook Lead Ads and I’m trying to create a PHP script that iterates through the array of data that Facebook sends.

The problem is that the array may contain multiple “entry” entries. So I need to iterate through the array and for every entry take some action.

This is an example of the array that I get:

JavaScript

So I thought of something like this:

JavaScript

But it doesn’t work. Any help would be much appreciated.

Advertisement

Answer

Refer to the documentation foreach should be according to the following syntaxe:

JavaScript

this simple code will help you :

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement