I have two arrays I need to compare with the operator <=. I thought an easy way to try and do this is using version_compare but I'm not sure that A. This is best method and B. It's actually comparing the right values.
In order for version_compare to work I implode the array.
//Original arrays.
a$ = array( 0 => "ajax dropdown0.1.5", 1 => "hello dolly1.6", 2 => "test4.5");
b$ = array( 0 => "ajax dropdown0.1.4", 1 => "hello dolly1.6", 2 => "test4.6");
//implode into string
$a_implode = implode( "," , $a );
$b_implode = implode( "," , $b );
//compare version
if (version_compare($a_implode, $b_implode, '<=')){
echo 'We have a problem';
}
This seems to work but I have no idea if it's actually comparing the correct values, for instance test4.5 must only be compared to test4.6 ( and not the other string values), also I am unsure how to output any matches if version_compare returns true.