Automattic\WooCommerce\Vendor\Detection

MobileDetect::prepareVersionNo()publicWC 1.0

Prepare the version number.

Method of the class: MobileDetect{}

No Hooks.

Return

float.

Usage

$MobileDetect = new MobileDetect();
$MobileDetect->prepareVersionNo( $ver ): float;
$ver(string) (required)
The string version, like "2.6.21.2152";

MobileDetect::prepareVersionNo() code WC 9.4.2

public function prepareVersionNo(string $ver): float
{
    $ver = str_replace(array('_', ' ', '/'), '.', $ver);
    $arrVer = explode('.', $ver, 2);

    if (isset($arrVer[1])) {
        $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions.
    }

    return (float) implode('.', $arrVer);
}