ciao a tutti sto cercando di implementare l'algoritmo bubble sort,perchè mi viene segnalato
come errore di sintassi la parentesi tonda che segue $j--
$count = count($array);
for($i = 0; $i< $count; $i++)
{
for($j = $count-1;$j < $i;$j–-) ----> errore
{
if ($array[$j] < $array[$j-1])
{
$tmp = $array[$j];
$array[$j] = $array[$j-1];
$array[$j-1] = $tmp;
}
}
}
print_r($array);