Bubble sort with php and javascript