Jump to content

Is This The Corect Json Format?


colap

Recommended Posts

array(3) {
[0]=>
string(18) "23.80484,090.40694"
[1]=>
string(18) "23.79942,090.41605"
[2]=>
string(18) "23.79118,090.41692"
}

 


string(64) "["23.80484,090.40694","23.79942,090.41605","23.79118,090.41692"]"

 

Is it the correct json format after json_encode ?

 

Isn't the json format contains { .. } ?

 

<?php
$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);

echo json_encode($arr);
?>

 

The above example will output:

 

 

{"a":1,"b":2,"c":3,"d":4,"e":5}

 

 

http://php.net/manua...json-encode.php

Link to comment
https://forums.phpfreaks.com/topic/269338-is-this-the-corect-json-format/
Share on other sites

Have a look at http://json.org which shows how JSON should be structured in easy to follow graphical form.

 

JSON is built on two structures:

- A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.

- An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

 

It is the array structure that you have.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.