想梦飞放.仙码.
刚才去打电话了
<?php
function versionCompare($v1, $v2){
preg_match_all ('/\d+/',$v1,$arr1);
preg_match_all ('/\d+/',$v2,$arr2);
foreach ($arr1 as $v) {foreach ($v as $arr1) {}}
foreach ($arr2 as $v) {foreach ($v as $arr2) {}}
if($arr1 < $arr2){
return $v2;
}elseif($arr1 > $arr2){
return $v1;
}else{
return '相等';
}
}
echo versionCompare('v1','v2');
这样对吗