<?php
header("Content-Type: text/html;charset=utf-8");
if(isset($_POST['generate'])){
foreach($_POST['arr'] as $k=>$v){
if(!is_numeric($v)){
$error = 'Все значения должны быть числами!';
break;
}
}
if(isset($error))
echo $error;
else{
$matrix = array_chunk($_POST['arr'], 4);
$table = '<table border="1"><tr>';
foreach($matrix as $k=>$v){
$i = 0;
foreach($v as $d){
$i++;
$table .= '<td align="center">'.$d.'</td>';
if($i%4==0)
$table .= '<tr/>';
}
}
$table .= '</re><table>';
echo $table;
echo '<pre>' . print_r($matrix, 1) . '</pre>';
}
}
?>
<form method="POST" action="">
<table>
<tr>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
</tr>
<tr>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
</tr>
<tr>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
<td><input type="text" size="5" maxlength="5" name="arr[]"/></td>
</tr>
</table>
<input type="submit" name="generate"/>
</form>
_____________
HTML, CSS (Bootstrap), JS(JQuery, ExtJS), PHP, MySQL, MSSql, Posgres, (TSql, BI OLAP, MDX), Mongo, Git, SVN, CodeIgnater, Symfony, Yii 2, JiRA, Redmine, Bitbucket, Composer, Rabbit MQ, Amazon (SQS, S3, Transcribe), Docker