css
codice:
<style type="text/css">
.rosso{
color:red;
}
</style>
Codice PHP:
function count_repeat_values($needle, $haystack){
$x = count($haystack);
for($i = 0; $i < $x; $i++){
if($haystack[$i] == $needle){
$needle_array[] = $haystack[$i];
}
}
$number_of_instances = count($needle_array);
return $number_of_instances;
}
$file = file('tuofile.txt');
$numeri = array();
foreach($file as $riga) {
$val = explode(',',$riga);
foreach($val as $sing)
$numeri[] = $sing;
}
echo '<table>';
foreach($file as $riga) {
echo '<tr>';
$val = explode(',',$riga);
foreach($val as $sing)
echo count_repeat_values($sing, $numeri) > 1 ? '<td>'.$sing.'</td>' : "<td class=\"rosso\">".$sing.'</td>';
echo '</tr>';
}
echo '<table>';