3

Here is an example:

$array = "[[51.228697283276,0.45897198252166],[51.228697283276,0.59374016480853],[51.312903819352,0.59374016480853],[51.312903819352,0.45897198252166]]";
0

2 Answers 2

8

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

json_decode($array);
Sign up to request clarification or add additional context in comments.

Comments

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); ?>

1 Comment

And why would that be better than json_decode($string)?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.