Siema, jestem dosyć świeży w PHP, bardziej przemawia do mnie front-end, ale muszę to wykonać w ramach rozwijania swoich skilli. Tak czy inaczej, potrzebuję rozbić tą tablicę:
[section] => Array
(
[0] => Array
(
['sectionwidth'] => 525
['sectionheight'] => 500
['bg'] => eaeaea
['sectioncolor'] => c0c0c0
['input'] => Array
(
[0] => Array
(
['inputtext'] => test
['inputwidth'] => 505
)
[3] => Array
(
['inputtext'] => test2
['inputwidth'] => 505
)
)
)
[1] => Array
(
['sectionwidth'] => 525
['sectionheight'] => 500
['bg'] => 222222
['sectioncolor'] => ffffff
['input'] => Array
(
[1] => Array
(
['inputtext'] => test3
['inputwidth'] => 505
)
[2] => Array
(
['inputtext'] => test4
['inputwidth'] => 505
)
)
)
)
Do takiej formy ostatecznej, jak mogę to zrobić?
<div style="width: '.$sectionwidth.'px; height: '.$sectionheight.'px; background: #'.$bg.'; color: '.$sectioncolor.'"><p style="width: '.$inputwidth.'px;">'.$inputtext.'</p></div>
Używając foreach'a na wartościach podzbioru input, otrzymuję informację, że próbuję zamienić tablicę na string.