Instead of doing :
<?php $strc = strcmp( strtolower($a[$f]), strtolower($b[$f]) ); ?>
you could do this :
<?php $strc = strcasecmp( $a[$f], $b[$f] ); ?>
which is more efficient and is does case insensitive comparison according to the current locale.