$custom_data = '';
$host="192.168.1..1";
exec("ping -c 1 " . $host, $output, $result);
if ($result == 0) $custom_data = "<img src='/set/img/ok.png' width='40' height='40' >"; else $custom_data = "<img src='/set/img/no.png' width='40' height='40' ";
foreach( $data as $value ):
# Разбиваем строку по |
$value = explode( "|", $value );
echo '<tr>';
{
echo '<td>' . $i++ . '</td>';
echo '<td>' . $value[0] . '</td>';
echo '<td>' . $value[1] . '</td>';
echo '<td>' . $value[2] . '</td>';
if($i == 4 /* 4 строка*/) $value[3] = $custom_data;
echo '<td>' . $value[3] . '</td>';
...
$new_format_task = array();
foreach($tasks as $task)
$new_format_task[$task["id"]][] = array(
"id" => $task["id"],
"id_task_".$task["id_task"]["task_time"] => $task["task_time"],
);