You can use this : https://www.php.net/manual/ro/function.max.php
$test = array(
array('G', 'M', 2, 2),
array(1, 2222, 3)
);
$arr = max($test);
// output ->
array(4) {
[0]=>
string(1) "G"
[1]=>
string(1) "M"
[2]=>
int(2)
[3]=>
int(2)
}