Skip to content

Instantly share code, notes, and snippets.

@VictorFursa
Created August 12, 2015 17:07
Show Gist options
  • Save VictorFursa/375ee134ed1f657fbb37 to your computer and use it in GitHub Desktop.
Save VictorFursa/375ee134ed1f657fbb37 to your computer and use it in GitHub Desktop.
<?php
$arraaa = array(
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100),
rand(1,100)
);
for($i = 0; $i < count($arraaa);$i++){
for($j = 0; $j < count($arraaa);$j++){
if($arraaa[$j] > $arraaa[$i]) {
$buffer = $arraaa[$i];
$arraaa[$i] = $arraaa[$j];
$arraaa[$j] = $buffer;
}
}
}
var_dump($arraaa);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment