I have one file which has coordinates and would like to extract these coordinates into variables `x1`, `x2`, `y1`, `y2` so that I can then get center lines using y = y2-y1 and x=x2-x1

For example, I want to convert file data like this:

```
points="94.08955764770508,275.3258819580078 99.92155838012695,275.3258819580078 99.92155838012695,281.16587829589844 94.08955764770508,281.16587829589844"

```

Into variables like this:

```
x1 = 94.08955764770508
y1 = 275.3258819580078
x2 = 99.92155838012695
y2 = 275.3258819580078

```

Here is the code that I have been trying:

```
$line = '<polygon id="svg_806" fill-rule="nonzero" fill="black" stroke-linejoin="round" stroke-width="0" points="94.08955764770508,275.3258819580078 99.92155838012695,275.3258819580078 99.92155838012695,281.16587829589844 94.08955764770508,281.16587829589844 "/>';

if (strpos($line,'<polygon') !== false) {
    $a = 1;

for ($i=0; $i <= 6; $i++) {
    $cordinates = explode('points="', $line);
    $cordinates = substr($cordinates[$i], 0, strpos($cordinates[$i], '"'));

foreach(explode(' ', $cordinates) as $value) {
$parts = explode(",", $value);
    echo trim($parts[0])."<br/>".trim($parts[1])."<br/>";

  }
}
}

```