I want you to click on the hyperlink for the second time to execute another code.
<a href=?ordem=nom>$lib_nom</a>
//ordena dados do array ASC
array_multisort( $affiche_ord, SORT_ASC, $affiche_tab );
//ordena dados do array DESC
array_multisort( $affiche_ord, SORT_DESC, $affiche_tab );
If you click once make the ASC if it is the second time DESC, and so on.