title: php explode a mysql geometry linestring type
body: <p>how could be the best way to transform a very long mysql linestring to an array(point by point) , I think using explode is the way, but it needs a litle much text manipulation before passing the string parameter to explode.</p>
  
  <p>This is the var_dump of the query result:</p>
  
  <pre><code>array (size=1)
      'route' =&gt; string 'LINESTRING(-25.3233034167988 -57.640113830566406,-25.3229348965009 -57.64023184776306,-25.322653656571582 -57.63954520225525,-25.323410093517822 -57.63928771018982,-25.3229058027454 -57.6378607749939,-25.322973688164012 -57.63678789138794,-25.323371301994506 -57.63360142707825,-25.322003892857673 -57.633676528930664,-25.31995759927745 -57.633376121520996,-25.319336915717006 -57.63331174850464,-25.317988857651912 -57.63302206993103,-25.317377862364236 -57.63294696807861,-25.317688209562228 -57.62954592704773'... (length=4354)
  </code></pre>
  
  <p>the objective is to have an array like this:
  route:</p>
  
  <pre><code>array (size=4354)
      0 =&gt; { x=&gt; '-25.3233034167988', y=&gt; '-57.640113830566406'}
      1 =&gt; { x=&gt; '-25.3229348965009 ', y=&gt; '-57.64023184776306'}
  </code></pre>
  
  <p>and so on</p>
  
  <p>with nickb code the result is:</p>
  
  <pre><code>array (size=112)
    0 =&gt; 
      array (size=2)
        'x' =&gt; string '-25.3233034167988' (length=17)
        'y' =&gt; string '-57.640113830566406' (length=19)
    1 =&gt; 
      array (size=2)
        'x' =&gt; string '-25.3229348965009' (length=17)
        'y' =&gt; string '-57.64023184776306' (length=18)
    2 =&gt; 
      array (size=2)
        'x' =&gt; string '-25.322653656571582' (length=19)
        'y' =&gt; string '-57.63954520225525' (length=18)
  </code></pre>
  
  <p>perfect</p>