title: post input data form to json txt file with php, the value without double quotes
body: <p>Here is my form html code</p>
  
  <pre><code>&lt;form action="save_json.php" method="post"&gt;
  Title: &lt;input type="text" name="title" id="title" /&gt;&lt;/br&gt;
  Latitude: &lt;input type="text" name="lat" id="lat" /&gt;&lt;/br&gt;
  Longitude: &lt;input type="text" name="lng" id="lng" /&gt;&lt;/br&gt;
  Description: &lt;input type="text" name="description" id="description" /&gt;&lt;/br&gt;
  Category: &lt;input type="text" name="category" id="category" /&gt;&lt;/br&gt;
  &lt;input type="submit" id="submit" value="Submit" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>And, here is my save_json.php code</p>
  
  <pre><code>&lt;?php
          // Append new form data in json string saved in text file
  
          // path and name of the file
      $filetxt = 'dirdata/data.txt';
  
          // check if all form data are submited, else output error message
          if(isset($_POST['title']) &amp;&amp; isset($_POST['lat']) &amp;&amp; isset($_POST['lng']) &amp;&amp; isset($_POST['description']) &amp;&amp; isset($_POST['category'])) {
          // if form fields are empty, outputs message, else, gets their data
          if(empty($_POST['title']) || empty($_POST['lat']) || empty($_POST['lng']) || empty($_POST['description']) || empty($_POST['category'])) {
              echo 'All fields are required';
          }
          else {
          // gets and adds form data into an array
          $data = array(
            'title'=&gt; $_POST['title'],
            'lat'=&gt; $_POST['lat'],
            'lng'=&gt; $_POST['lng'],
            'description'=&gt; $_POST['description'],
            'category'=&gt; $_POST['category'],
          );
  
          // path and name of the file
          $filetxt = 'dirdata/data.txt';
  
          $arr_data = array();        // to store all form data
  
          // check if the file exists
          if(file_exists($filetxt)) {
            // gets json-data from file
            $jsondata = file_get_contents($filetxt);
  
            // converts json string into array
            $arr_data = json_decode($jsondata, true);
          }
  
          // appends the array with new form data
          $arr_data[] = $data;
  
          // encodes the array into a string in JSON format (JSON_PRETTY_PRINT - uses whitespace in json-string, for human readable)
          $jsondata = json_encode($arr_data, JSON_PRETTY_PRINT);
  
          // saves the json string in "data.txt" (in "dirdata" folder)
          // outputs error message if data cannot be saved
          if(file_put_contents('dirdata/data.txt', $jsondata)) echo 'Data successfully saved';
          else echo 'Tidak dapat menyimpan data di "dirdata/data.txt"';
        }
      }
          else echo 'Form fields not submited';
      ?&gt;
  </code></pre>
  
  <p>The output is like this</p>
  
  <pre><code>[
      {
      "title": "title",
      "lat": "-6.9000",
      "lng": "-110.000",
      "description": "description",
      "category": "category"
      }
  ]
  </code></pre>
  
  <p>The output that I want is the value at latitude &amp; longitude without double quotes ( " ) like this</p>
  
  <pre><code>[
      {
      "title": "title",
      "lat": -6.9000, // &lt;-- no double quotes
      "lng": -110.000,
      "description": "description",
      "category": "category"
      }
  ]
  </code></pre>
  
  <p>Anyone can help me how to solve it? Thank you for any help</p>