Re: php+html mixup in displaying multidimensional array in html tables [message #176853 is a reply to message #176852] |
Sat, 28 January 2012 23:08 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma:
|
Senior Member |
|
|
Michael Fesser wrote:
> .oO(Thomas 'PointedEars' Lahn)
>
>> This is how you would write virtually unmaintainable, error-prone, slow code
>> that very likely also produces invalid HTML after a few changes.
>>
>> Please don't.
>>
>> <table>
>> <?php
>> foreach ($arr as $line)
>> {
>> ?>
>> <tr>
>> <?php
>> foreach ($line as $cell)
>> {
>> ?>
>> <td><?php echo htmlspecialchars($cell); ?></td>
>
> [...]
>
> You call _that_ maintainable and readable? IBTD.
>
I assume he was demonstrating the exact opposite actually.
"This is how you would write virtually unmaintainable, error-prone, slow
code that very likely also produces invalid HTML after a few changes."
|
|
|