Bonjour,
Tu peux parcourir tes chiffres un a un et créer ton html...
Code PHP :
<?php
$compt = 125;
$html = '';
for($i= 0, $t = (strlen($compt)-1); $i < $t; $i++)
{
$html .= '<img src="/compteur/'.$compt[$i].'.png" alt="'.$compt[$i].'" title="'.$compt.'" />';
}
// Bonus
// On ajoute des 0 avant si le nombre a moins de $affchi chiffres...
// Ici ca va faire 0125
$affchi = 4;
for($i= 0, $t = ($affchi-strlen($compt)); $i < $t; $i++)
{
$html = '<img src="/compteur/0.png" alt="0" title="'.$compt.'" />'.$html;
}
?>
_________________________________
Min iPomme