private static function parsePercent($input, &$result)
    {
        // Detect and remove percent sign
        if (preg_match('/^\\s*(\\d*(?:\\.\\d*)?)%\\s*$/', $input, $matches)) {
            $result = floatval($matches[1]) / 100;
            
            if ($result < 0) $result = 0;
            if ($result > 1) $result = 1;
            
            return true;
        }
        return false;
    }
private static function parsePercent($input, &$result)
    {
        // Detect and remove percent sign
        if (preg_match('/^\\s*(\\d*(?:\\.\\d*)?)%\\s*$/', $input, $matches)) {
            $result = floatval($matches[1]) / 100;
            
            if ($result < 0) $result = 0;
            if ($result > 1) $result = 1;
            
            return true;
        }
        return false;
    }
private static function parsePercent ( $ input , & $ result ) { // Detect and remove percent sign if ( preg_match ( '/^\\s*(\\d*(?:\\.\\d*)?)%\\s*$/' , $ input , $ matches ) ) { $ result = floatval ( $ matches [ 1 ] ) / 100 ; if ( $ result < 0 ) $ result = 0 ; if ( $ result > 1 ) $ result = 1 ; return true ; } return false ; }
Parses a percent value.

@param string $input Input string.
@param float $result Resulting value in range [0, 1].

@return boolean
Parses a percent value .