$arr1[$j1 + 1]) { $t1 = $arr1[$j1]; $arr1[$j1] = $arr1[$j1 + 1]; $arr1[$j1 + 1] = $t1; } } } } $len1 = sizeof($arr1); bubbleSort1($arr1); // print out the sorted array (optional, will slow down the speed test, use "time php MattLondonSpeedTest_v1.php" to run it // PrintOptionA: (simply use php build in function) // print_r($arr1); // // PinrtOptionB: (manually iterate over the array) // echo "Sorted array : \n"; // for ($i1 = 0;$i1 < $len1;$i1++) echo $arr1[$i1] . " "; ?>