重新排序数组,将包含下划线的所有字符串移动到底部

I am trying to move the strings that contain an underscore _ to the bottom of my array. I'm assuming usort() is the best way but not sure how to do this in the most efficient way. Let's say my array is '1','34_1','35_1','36_1','7','41_4','38_5','5','41_5','44_5','45_5'

usort(['1','34_1','35_1','36_1','7','41_4','38_5','5','41_5','44_5','45_5'], function (){...});

UPDATE: I think I found a way to do it:

$myarray = ['1','34_1','35_1','36_1','7','41_4','38_5','5','41_5','44_5','45_5'];

function sortem($myarray) {
    foreach ($myarray as $index=>$item)
    {
        if (preg_match('/^_+$/', $item))
        {
            unset($myarray[$index]);
            $myarray[$index] = $item;               
        }
    }
}
usort($myarray, "sortem");
$tagsuri = array_reverse($tagsuri);

Is there a better way?

I am sure you could find a way to usort() but a quick way to do this would just be to split the array into two, then combine them back:

<?php
$myarray = array('1','34_1','35_1','36_1','7','41_4','38_5','5','41_5','44_5','45_5');

foreach($myarray as $value) {
    # Put all numbers into one array, underscored into a second
    if(strpos($value,'_') !== false)
        $strArr[]   =   $value;
    else
        $numArr[]   =   $value;
}
# Sort both arrays
# You'll probably want to do checks to see that they are not empty first
asort($strArr);
asort($numArr);
# Combine arrays
print_r(array_merge($numArr,$strArr));

Gives you:

Array
(
    [0] => 1
    [1] => 5
    [2] => 7
    [3] => 34_1
    [4] => 35_1
    [5] => 36_1
    [6] => 38_5
    [7] => 41_4
    [8] => 41_5
    [9] => 44_5
    [10] => 45_5
)