<?php

function cmp($a, $b)
{
    $a = $tmp = preg_replace('~\D~', '', $a['name']);
    $b = $tmp = preg_replace('~\D~', '', $b['name']);

    if ($a == $b) {
        return 0;
    }

    return ($a < $b) ? -1 : 1;
}

function smarty_modifier_sort_variation_labels($arrData)
{
    usort($arrData, 'cmp');

    return $arrData;
}
