Compare decimal numbers in an alphanumeric value without preg_replace - PHP -
is possible compare decimal values value contains alphanumeric characters without using preg_replace
or stripping out non-numeric values?
for instance comparing these 2 decimal values ( ignoring letters) simple operator >
:
'down0.1.5.3'
'down0.1.7.1'
var_dump(version_compare('down0.1.5.3', 'down0.1.7.1')); var_dump(version_compare('down0.1.8.3', 'down0.1.7.1'));
Comments
Post a Comment