Can php strings be directly compared in size?

see the function array_diff_ukey in the official manual. The examples in

are as follows.
<?php
function key_compare_func($key1, $key2)
{
    if ($key1 == $key2)
        return 0;
    else if ($key1 > $key2)
        return 1;
    else
        return -1;
}

$array1 = array("blue"  => 1, "red"  => 2, "green"  => 3, "purple" => 4);
$array2 = array("green" => 5, "blue" => 6, "yellow" => 7, "cyan"   => 8);

var_dump(array_diff_ukey($array1, $array2, "key_compare_func"));
The callback function

key_compare_func directly compares the size of strings in key?

Apr.05,2021

strcmp learn about it and directly replace key_compare_func

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e48e10-44cda.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e48e10-44cda.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?