Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
511 B
33
Indexable
Never
$xml = simplexml_load_file('https://www.jambox.pl/xml/listakanalow-pluspodstawowy.xml');
$m = 0;
$mod = 9;
print('<table>');
foreach($xml -> node as $item) {
	if ( ( $m % $mod ) == 0 ){
		print('<tr>');
	}
	print('<td>'.$item->field_logo_fid.'</td>');
	if ( ( $m % $mod ) == ( $mod - 1 ) ){
		print('</tr>');
	}
	$m++;
}

if (( $m % $mod ) !== 0 && ( $m % $mod ) !== ( $mod - 1 )){
	for ( $x = 0; $x < ($mod - ($m % $mod)); $x++ ) print('<td> </td>');
	print('</tr>');
}
print('</table>');
Leave a Comment