Algorithms are algorithms, if you make some modifications and achieve a better performance you won't be using the Bubble sorting algorithm anymore, because it would have changed.
If you want a increase performance you need to change the algorithm, Quick Sort is generally considered to be the best sorting one. As an example of the implementation in php:
// QuickSort Algorithm function
function quickSort(array $array) {
if (count($array) == 0) {
return $array;
}
$pivot = $array[0];
$left = $right = array();
for($i = 1; $i < count($array); $i ++) {
if ($array[$i] < $pivot) {
$left[] = $array[$i];
} else {
$right[] = $array[$i];
}
}
return array_merge(quickSort($left), array(
$pivot
), quickSort($right));
}
Of course, it always depends on the situation, if you optimize it you would be basing your code on that algorithm but not making bubble algorithm better or more effective.
Check this post, where is really well documented almost every type of sorting in php.
Hope this helps you!