double quotas appearing after json output in PHP array to JSON
<p>I have read a question answer at </p>

<p><a href="https://stackoverflow.com/questions/11012695/php-array-to-json-how-to-get-rid-of-some-double-quotes">PHP Array to json, how to get rid of some double quotes?</a></p>

<p>I have same issue but my code is little different so I unable to ride of rid of some double quotes.</p>

<p>My code : </p>

<pre><code>$features = array();
$geojson = array(
    'type'      =&gt; 'FeatureCollection',
    'features'  =&gt; $features
 );
while($row = mysqli_fetch_assoc($result)) {
$type = $row['type'];
if($type == 'Point')
    {
        //$output = ;
            $feature = array(
        'type' =&gt; 'Feature',
         'properties' =&gt; array(
             'score' =&gt; "",
             'fid' =&gt; ""
        //Other fields here, end without a comma
            ),

      'geometry' =&gt; array(
        'type' =&gt; $type,
        'coordinates' =&gt; array($row['lat'], $row['lng'])
            )
        );
    }
else {
//$output = '['.$row['more_info'].']';
$feature = array(
        'type' =&gt; 'Feature',
         'properties' =&gt; array(
             'score' =&gt; "",
             'fid' =&gt; ""
        //Other fields here, end without a comma
            ),

      'geometry' =&gt; array(
        'type' =&gt; $type,
        'coordinates' =&gt; array('['.$row['more_info'].']')
            )
        );
}

    array_push($geojson['features'], $feature);
};
    mysqli_close($conn);
    echo $newgeojson =  json_encode($geojson, JSON_NUMERIC_CHECK);
</code></pre>

<p>array Output before convert to json (json_encode):</p>

<pre><code>Array
(
    [type] =&gt; FeatureCollection
    [features] =&gt; Array
        (
            [0] =&gt; Array
                (
                    [type] =&gt; Feature
                    [properties] =&gt; Array
                        (
                            [score] =&gt; 
                            [fid] =&gt; 
                        )

                    [geometry] =&gt; Array
                        (
                            [type] =&gt; Point
                            [coordinates] =&gt; Array
                                (
                                    [0] =&gt; 88.388786315918
                                    [1] =&gt; 22.551879205144
                                )

                        )

                )

            [1] =&gt; Array
                (
                    [type] =&gt; Feature
                    [properties] =&gt; Array
                        (
                            [score] =&gt; 
                            [fid] =&gt; 
                        )

                    [geometry] =&gt; Array
                        (
                            [type] =&gt; Polygon
                            [coordinates] =&gt; Array
                                (
                                    [0] =&gt; [[88.41796875, 22.568048815726],[88.41796875, 22.572804222704],[88.41796875, 22.577876475976],[88.428955078125, 22.578114233267],[88.428955078125, 22.573121244003],[88.428611755371, 22.568048815726],[88.41796875, 22.568048815726]]
                                )

                        )

                )

        )

)
</code></pre>

<p>Output I am getting after json_encode</p>

<pre><code>{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"score":"","fid":""},"geometry":{"type":"Point","coordinates":[88.388786315918,22.551879205144]}},{"type":"Feature","properties":{"score":"","fid":""},"geometry":{"type":"Polygon","coordinates":["[[88.41796875, 22.568048815726],[88.41796875, 22.572804222704],[88.41796875, 22.577876475976],[88.428955078125, 22.578114233267],[88.428955078125, 22.573121244003],[88.428611755371, 22.568048815726],[88.41796875, 22.568048815726]]"]}}]}
</code></pre>

<p>As you can see the coordinates coming with " ".</p>

<pre><code>"[[88.41796875, 22.568048815726],[88.41796875, 22.572804222704],[88.41796875, 22.577876475976],[88.428955078125, 22.578114233267],[88.428955078125, 22.573121244003],[88.428611755371, 22.568048815726],[88.41796875, 22.568048815726]]"
</code></pre>

<p>I do not want that double quote start and end of multi coordinates.</p>

<p>Please guide / suggest me how can I ride of those double quote.</p>