<?php
header('Content-Type: text/html; charset=utf-8');
$arr = array(
array( 'text' => 'Текст красного цвета',
'align' => 'center',
'valign' => 'center',
'bgcolor' => '#0000FF',
'colspan' => 2,
'rowspan' => 2,
'width' =>200,
'class' =>'red'
)
, array( 'text' => 'Текст зеленого цвета'
, 'cells' => '8,9'
, 'align' => 'right'
, 'valign' => 'bottom'
, 'bgcolor' => '#FFFFFF',
'colspan' => 2,
'class' =>'green'
));
$array0 = $arr[0];
$array1 = $arr[1];
$firstArray0 = array_shift($array0);
$firstArray1 = array_shift($array1);
$td1 .= "<td ";
foreach ($array0 as $k0 => $v0)
{
$td1 .= $k0."=".$v0." ";
}
$td1 .= ">";
$td1 .= $firstArray0;
$td1 .= "</td>";
$td2 .= "<td ";
foreach ($array1 as $k1 => $v1)
{
$td2 .= $k1."=".$v1." ";
}
$td2 .= ">";
$td2 .= $firstArray1;
$td2 .= "</td>";
$td = "<td width='100' height='100'></td>";
$table .= "<table>";
for ($i=0, $td1; $i<3; $i++)
{
$table .= "<tr>";
if ($i == 0)
{
$table .= $td1;
$table .= $td;
}
elseif ($i == 1)
{
$table .= $td;
}
elseif ($i == 2)
{
$table .= $td;
$table .= $td2;
}
$table .= "</tr>";
}
$table .= "</table>";
echo "<!DOCTYPE html>";
echo "<style>td{border: 1px solid black;} .red{color:red} .green{color:green}</style>";
echo $table;
- Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- Warning: Undefined variable $td1 in /in/8hWmu on line 27
Warning: Undefined variable $td2 in /in/8hWmu on line 35
Warning: Undefined variable $table in /in/8hWmu on line 45
<!DOCTYPE html><style>td{border: 1px solid black;} .red{color:red} .green{color:green}</style><table><tr><td align=center valign=center bgcolor=#0000FF colspan=2 rowspan=2 width=200 class=red >Текст красного цвета</td><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td><td cells=8,9 align=right valign=bottom bgcolor=#FFFFFF colspan=2 class=green >Текст зеленого цвета</td></tr></table>
- Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
- Notice: Undefined variable: td1 in /in/8hWmu on line 27
Notice: Undefined variable: td2 in /in/8hWmu on line 35
Notice: Undefined variable: table in /in/8hWmu on line 45
<!DOCTYPE html><style>td{border: 1px solid black;} .red{color:red} .green{color:green}</style><table><tr><td align=center valign=center bgcolor=#0000FF colspan=2 rowspan=2 width=200 class=red >Текст красного цвета</td><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td><td cells=8,9 align=right valign=bottom bgcolor=#FFFFFF colspan=2 class=green >Текст зеленого цвета</td></tr></table>
- Output for 7.3.32 - 7.3.33
- <!DOCTYPE html><style>td{border: 1px solid black;} .red{color:red} .green{color:green}</style><table><tr><td align=center valign=center bgcolor=#0000FF colspan=2 rowspan=2 width=200 class=red >Текст красного цвета</td><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td><td cells=8,9 align=right valign=bottom bgcolor=#FFFFFF colspan=2 class=green >Текст зеленого цвета</td></tr></table>
- Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.3
- Notice: Undefined variable: td1 in /in/8hWmu on line 27
Notice: Undefined variable: td2 in /in/8hWmu on line 35
Notice: Undefined variable: table in /in/8hWmu on line 45
<!DOCTYPE html><style>td{border: 1px solid black;} .red{color:red} .green{color:green}</style><table><tr><td align=center valign=center bgcolor=#0000FF colspan=2 rowspan=2 width=200 class=red >Текст красного цвета</td><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td></tr><tr><td width='100' height='100'></td><td cells=8,9 align=right valign=bottom bgcolor=#FFFFFF colspan=2 class=green >Текст зеленого цвета</td></tr></table>
preferences:
251.21 ms | 403 KiB | 456 Q