I believe that the simplest way to pass complex data from C# to PHP is through WCF service. See my previous post How to implement WCF service in PHP for more details.
Let assume we have a WCF service contract that has the following method with some nested dictionary as a parameter:
[ServiceContract]
public interface IStore
{
[OperationContract]
void UpdateRows(Dictionary<int, Dictionary<string, object>> rows);
}
Below I provided the sample implementation of UpdateRows in PHP that iterates through nested dictionaries (first level called ‘rows’ and second level called ‘properties’):
(more…)