Skip to content

Instantly share code, notes, and snippets.

@ubermuda
Created October 22, 2008 13:05
Show Gist options
  • Select an option

  • Save ubermuda/18633 to your computer and use it in GitHub Desktop.

Select an option

Save ubermuda/18633 to your computer and use it in GitHub Desktop.
<?php
$string = 'BOX(534927.21 2184044.55,743600 2471494)';
preg_match_all('/(\d+)(?:\.\d+)?/', $string, $matches);
/*
array(2) {
[0]=>
array(4) {
[0]=>
string(9) "534927.21"
[1]=>
string(10) "2184044.55"
[2]=>
string(6) "743600"
[3]=>
string(7) "2471494"
}
[1]=>
array(4) {
[0]=>
string(6) "534927"
[1]=>
string(7) "2184044"
[2]=>
string(6) "743600"
[3]=>
string(7) "2471494"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment