Navigation :
HomeSource code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links
Site Sponsors :
- Load Cells
- Best MySQL & PHP Webhosting + save 50%
- κατασκευή ιστοσελίδων
Bookmark :
Links :
wwwstoresgolfing products
software directory
Downloads :
Misc :
Webmaster ResourcesOnly PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming
Bubblesort routine
Bubblesort routine
<?
function BubbleSort($sort_array,$reverse)
{
for ($i = 0; $i < sizeof($sort_array); $i++){
for ($j = $i + 1; $j < sizeof($sort_array); $j++){
if($reverse){
if ($sort_array[$i] < $sort_array[$j]){
$tmp = $sort_array[$i];
$sort_array[$i] = $sort_array[$j];
$sort_array[$j] = $tmp;
}
}else{
if ($sort_array[$i] > $sort_array[$j]){
$tmp = $sort_array[$i];
$sort_array[$i] = $sort_array[$j];
$sort_array[$j] = $tmp;
}
}
}
}
return $sort_array;
}
?>
Use like this
$array = array{10,65,32,41,1,99};
$sorted = BubbleSort($array,0);
submitted by anon
Books :
Sponsors :
Random Code :
User chooses stock quotes(internet)Count words in a sentence(string)
list all databases on a server(database)
Random Article :
PHP EncryptionPHP Pear Packages Why they are so important to php developers
Network:
Programming resourcesTutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Del.icio.us
Digg
Furl
Newsvine
Netscape
Reddit
StumbleUpon
Technorati
Squidoo
Windows Live
Yahoo MyWeb
Ask
Google