I have spent some time reviewing all the array functions ... and using search to find anything that referenced 'reindexing array' (or the like) ... and no real matches were found.
Actually the SORT() function does not return an array.
From the Man => void sort ( array array [, int sort_flags])
so the equation you posted is not valid.
SORT() does arrange the array in various ways, however, the empty key-value pairs are not removed from the resulting array. They are simply reordered. In fact, the empty key-value pairs wind up at the front of the array.
try this and you will see the results ...
<?php
$ar1 = array (a,b,c,d,e,f,g);
print_r ($ar1);
echo "<br>\n";
echo "<br>\n";
$ar1[3]="";
$ar1[5]="";
$ar2=$ar1;
print_r ($ar2);
echo "<br>\n";
echo "<br>\n";
sort($ar2);
print_r ($ar2);
?>
I am interested in knowing if there is a PHP function that 'compacts' the array by removing any $key that has a value of "".
Thanks for trying!