3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayToTable($arData) { $resString = ""; if(is_array($arData)) { $resString = "<table col='6' id='decisList' >" ."<thead>" ."<tr align=center>" ."<th width=20>#</th>" ."<th width=50>Данные постановления</th>" ."<th width=80>ID по ФИАС</th>" ."<th>Контактный e-mail</th>" ."<th width=80>Приложение</th>" ."<th width=50>Действия</th>" ."</tr>" ."</thead>" ."<tbody>"; // ------------------------ Тело таблицы --------------------- // $rnum = 0; foreach($arData as $arItem) { $resString .= "<tr decId=\"".$arItem["CODE"]."\" id=\"sid_".substr($arItem["ID"],-20)."\" >" ."<td>".++$rnum."</td>" ."<td class='decis'>".$arItem["NAME"]."</td>" ."<td class='gid'>".$arItem["CODE"]."</td>" ."<td class='email'>".$arItem["EMAIL"]."</td>" ."<td class='postnum'><a href='".$arItem["ATT"]."' target='_blank' title='Скачать приложенный файл'>Скачать</a></td>" ."<td class='actions' align=\"right\"><b>ПОДТВЕРЖДЕНО</b> | <b>НЕ ПОДТВЕРЖДЕНО</b></td>" ."</tr>"; } // ------------------------ Тело таблицы END --------------- // $resString .= "</tbody>" ."</table>"; } return $resString; } echo arrayToTable(array( array( "ID"=>"111", "CODE"=>"333", "NAME"=>"222", "EMAIL"=>"3333", "ATT"=>"222" ) )); ?>
Output for git.master, git.master_jit, rfc.property-hooks
<table col='6' id='decisList' ><thead><tr align=center><th width=20>#</th><th width=50>Данные постановления</th><th width=80>ID по ФИАС</th><th>Контактный e-mail</th><th width=80>Приложение</th><th width=50>Действия</th></tr></thead><tbody><tr decId="333" id="sid_111" ><td>1</td><td class='decis'>222</td><td class='gid'>333</td><td class='email'>3333</td><td class='postnum'><a href='222' target='_blank' title='Скачать приложенный файл'>Скачать</a></td><td class='actions' align="right"><b>ПОДТВЕРЖДЕНО</b> | <b>НЕ ПОДТВЕРЖДЕНО</b></td></tr></tbody></table>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
74.17 ms | 402 KiB | 8 Q