Anglais Francais Prosygma 

Italie
-
    hebergement 

asp
prosygma_logo



 Divers (1)  Chaînes (31)  Dates (18)  Nombres (8)  Structures (5) 
 Tableaux (6) 
array - invArray/array_reverse - join/implode - multiSort/sort - split/explode - ubound/sizeof
INVARRAY/ARRAY_REVERSE 
Inverse un tableau
ASP <Doc> 
<% ' Merci Aurelien !
Function invArray(ByVal inArray)
  ' Cette function renvoie un Array inverse
  '   - inArray : Array a inverser
  ' Declarations des variables
  Dim laTaille
  Dim i
  Dim outArray()
  ' On recupere la taille de inArray
  laTaille = UBound(inArray)
  ' On redimensionne l'Array de retour
  ReDim outArray(laTaille)
  ' On boucle sur l'Array
  For i = LBound(inArray) to UBound(inArray)
    ' On inverse l'ordre
    outArray(laTaille - i) = inArray(i)
  Next
  ' On retourne l'Array inverse
  invArray = outArray
End Function

tableau2 = invArray(tableau)
%>

PHP <Doc> 
<?
$tableau2=array_reverse($tableau);
?>

JavaScript <Doc> 
<script>
tableau2=tableau.reverse()
</script>

© ASP-PHP.net 11/01/2003