3

Here is an example:

$array = "[[51.228697283276,0.45897198252166],[51.228697283276,0.59374016480853],[51.312903819352,0.59374016480853],[51.312903819352,0.45897198252166]]";
Hard worker
  • 3,916
  • 5
  • 44
  • 73

2 Answers2

8

That looks like JSON. You can use json_decode() to decode it:

json_decode($array);
rid
  • 61,078
  • 31
  • 152
  • 193
1

Use this code for make this string to an array

    <?php 
$string ="[[51.228697283276,0.45897198252166],[51.228697283276,0.59374016480853],[51.312903819352,0.59374016480853],[51.312903819352,0.45897198252166]]";
$array = explode(',',$string);
for($i=0;$i<count($array);$i++){
    $array[$i] = trim($array[$i],'[[');
    $array[$i] = trim($array[$i],']]');
}
echo '<pre>'; print_r($array); ?>
Prashant Parekh
  • 428
  • 1
  • 6
  • 27