Skip to content
Closed
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).

- Drop support for PHP 7.1, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
- Drop partial migration tool in favor of complete migration via RectorPHP [#1445](https://github.com/PHPOffice/PhpSpreadsheet/issues/1445)
- Cell Coordinate range now supports a space delimiter

## [1.12.0] - 2020-04-27

Expand Down
8 changes: 7 additions & 1 deletion src/PhpSpreadsheet/Cell/Coordinate.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ public static function splitRange($pRange)
$pRange = self::DEFAULT_RANGE;
}

$exploded = explode(',', $pRange);
if (strpos(trim($pRange), ' ') !== false) {
$delimiter = ' ';
} else {
$delimiter = ',';
}

$exploded = explode($delimiter, $pRange);
$counter = count($exploded);
for ($i = 0; $i < $counter; ++$i) {
$exploded[$i] = explode(':', $exploded[$i]);
Expand Down
13 changes: 13 additions & 0 deletions tests/data/CellSplitRange.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,17 @@
],
'B4:E9,H2:O11',
],
[
[
[
'B4',
'E9',
],
[
'H2',
'O11',
],
],
'B4:E9 H2:O11',
],
];