Hi
Hope someone can help me with this!
I'm trying to get a table of data into a multidimensiona l array.
The table fields are as follows;
Only one row of data will have a value for field "type". There will eventually be dozens of other rows.
I need to place the data into an array with the following structure;
All rows aside from the one where type="default" will be within "date".
I'm completely stuck with this. I've been trying to build the arrays from multiple variables, but it's just not working. I'll add that I'm still pretty new to PHP.
Any assistance you can offer with this would be MUCH appreciated!
Thank you.
Hope someone can help me with this!
I'm trying to get a table of data into a multidimensiona l array.
The table fields are as follows;
Code:
headline text startDate type media caption credit
I need to place the data into an array with the following structure;
Code:
$array = array( "timeline" => array( "headline" => "value", "text" => "value", "startDate" => "value", "type" => "default", "asset" => array( "media" => "value, "caption" => "value", "credit" => "value" ), "date" => array( "1" => array ( "headline" => "value", "text" => "value", "startDate" => "value", "type" => "", "asset" => array( "media" => "value, "caption" => "value", "credit" => "value" ) ), "2" => array ( "headline" => "value", "text" => "value", "startDate" => "value", "type" => "", "asset" => array( "media" => "value, "caption" => "value", "credit" => "value" ) ) );
I'm completely stuck with this. I've been trying to build the arrays from multiple variables, but it's just not working. I'll add that I'm still pretty new to PHP.
Any assistance you can offer with this would be MUCH appreciated!
Thank you.
Comment