<?php
$sections = [
[
'sectionwidth' => 525,
'sectionheight' => 500,
'bg' => 'eaeaea',
'sectioncolor' => 'c0c0c0',
'input' => [
[
'inputtext' => 'test',
'inputwidth' => 505
],
[
'inputtext' => 'test2',
'inputwidth' => 505
]
]
],
[
'sectionwidth' => 525,
'sectionheight' => 500,
'bg' => '222222',
'sectioncolor' => 'ffffff',
'input' => [
[
'inputtext' => 'test3',
'inputwidth' => 505
],
[
'inputtext' => 'test4',
'inputwidth' => 505
]
]
],
[
'sectionwidth' => 525,
'sectionheight' => 500,
'bg' => 'eaeaea',
'sectioncolor' => 'c0c0c0',
'input' => [
[
'inputtext' => 'test5',
'inputwidth' => 505
],
[
'inputtext' => 'test6',
'inputwidth' => 505
],
[
'inputtext' => 'test7',
'inputwidth' => 505
],
[
'inputtext' => 'test8',
'inputwidth' => 505
]
]
],
[
'sectionwidth' => 525,
'sectionheight' => 500,
'bg' => '222222',
'sectioncolor' => 'ffffff',
'input' => [
[
'inputtext' => 'test9',
'inputwidth' => 505
],
[
'inputtext' => 'test10',
'inputwidth' => 505
]
]
],
];
// kodu generującego poniżej nie zmianiałem
foreach ($sections as $section) {
echo '<div style="width: '.$section['sectionwidth'].'px; height: '.$section['sectionheight'].'px; background: #'.$section['bg'].'; color: '.$section['sectioncolor'].'">';
foreach ($section['input'] as $input) {
echo '<p style="width: '.$input['inputwidth'].'px;">'.$input['inputtext'].'</p>';
}
echo '</div>';
}
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- <div style="width: 525px; height: 500px; background: #eaeaea; color: c0c0c0"><p style="width: 505px;">test</p><p style="width: 505px;">test2</p></div><div style="width: 525px; height: 500px; background: #222222; color: ffffff"><p style="width: 505px;">test3</p><p style="width: 505px;">test4</p></div><div style="width: 525px; height: 500px; background: #eaeaea; color: c0c0c0"><p style="width: 505px;">test5</p><p style="width: 505px;">test6</p><p style="width: 505px;">test7</p><p style="width: 505px;">test8</p></div><div style="width: 525px; height: 500px; background: #222222; color: ffffff"><p style="width: 505px;">test9</p><p style="width: 505px;">test10</p></div>
preferences:
112.18 ms | 405 KiB | 174 Q