Parsing JSON in PHP "stdClass could not be converted to string" error
I had this string:

    {\"lat\":37.790388261934424,\"lng\":-122.46047996826172},{\"lat\":37.789608231530124,\"lng\":-122.46344112701416}

Then thanks to the help of StackOverflowers, I did this to strip the slashes:

    $markers = stripslashes($markers);

Then I tried to add the outside brackets which seemed to be needed by the decode function

    $markers = json_decode('['.$markers.']');

Was that the right way to go about it?  Then I tried to do this:

    foreach($markers as $key => $value) 
    {
        $some_string = $some_string.' ( '.$value.' ) ';
    }

Which game me this error:

    Object of class stdClass could not be converted to string

But what I really need is to extract the lat/lng values into $lat , $lng variables.  Could someone suggest to me how to fix the error I am getting and put the values into the variables?

Thanks,
Alex
Parsing JSON in PHP "stdClass could not be converted to string" error
===

I had this string:

    {\"lat\":37.790388261934424,\"lng\":-122.46047996826172},{\"lat\":37.789608231530124,\"lng\":-122.46344112701416}

Then thanks to the help of StackOverflowers, I did this to strip the slashes:

    $markers = stripslashes($markers);

Then I tried to add the outside brackets which seemed to be needed by the decode function

    $markers = json_decode('['.$markers.']');

Was that the right way to go about it?  Then I tried to do this:

    foreach($markers as $key => $value) 
    {
        $some_string = $some_string.' ( '.$value.' ) ';
    }

Which game me this error:

    Object of class stdClass could not be converted to string

But what I really need is to extract the lat/lng values into $lat , $lng variables.  Could someone suggest to me how to fix the error I am getting and put the values into the variables?

Thanks,
Alex