title: show only one value from ajax return array
body: <p>How can I display only one thing from the array. Now it shows the whole array but I only want to show the reason from the array. because the rest is't really important. I have added index.php to show what I do there. I would like that it only showed the reason from data.</p>
  
  <p><em>test.js</em></p>
  
  <pre><code>$(document).ready(function() {
  
  var date = "";
  var begin = "";
  var tijdsduur = "";
  var aantal = "";
  
  
  $('#datum').change(function() {
      date = $("#datum").val();
      console.log(date);
  });
  $('#beginTijd').change(function() {
      begin = ($(this).val());
      console.log(begin);
  });
  $('#Tijdsduur').change(function() {
      tijdsduur = ($(this).val());
      console.log(tijdsduur);
  });
  $('#aantalSloepen').change(function() {
      aantal = ($(this).val());
      console.log(aantal);
      $.ajax({
          type: "POST",
          url: "index.php",
          data: {
              date: date,
              begin: begin,
              eind: tijdsduur,
              quantity: aantal
          },
          success: function(data) {
              $('#testajax').html(data);
              console.log(data);
          }
      });
  });
  });
  </code></pre>
  
  <p><em>index.php</em></p>
  
  <pre><code>        &lt;?php
      $date = "";
      $begin = "";
      $tijdsduur = "";
      $aantal = "";
      if (isset($_POST['date']) &amp;&amp; isset($_POST['quantity'])) {
        if (isset($_POST['date'])) {
              print_r($_POST);
              // echo "Yes, mail is set";
              $date = $_POST['date'];
              $begin = $_POST['begin'];
              $tijdsduur = $_POST['eind'];
              $aantal = $_POST['quantity'];
              $eind = $begin + $tijdsduur;
              $startTijd = "$date " . $begin;
              $eindTijd = "$date " . $eind . ":00";
              // echo $date . "&lt;br&gt;";
              // echo "$startTijd". "&lt;br&gt;";
              // echo "$eindTijd". "&lt;br&gt;";
              // echo $aantal. "&lt;br&gt;";
              $canmakereservation = "https://www.planyo.com/rest/?method=can_make_reservation&amp;api_key=YOURKEY&amp;resource_id=110556&amp;start_time=$startTijd&amp;end_time=$eindTijd&amp;quantity=$aantal";
                      $cleancanmakereservation = preg_replace("/ /", "%20", $canmakereservation);
                      $reservationavailable = file_get_contents("$cleancanmakereservation");
                      $reservationAvailable = json_decode($reservationavailable, true);
                      // echo "$cleancanmakereservation";
                      echo json_encode($reservationAvailable);
          }
          else {
              echo "No, mail is not set";
        }
        exit;
      }
      ?&gt;
  </code></pre>
  
  <p>console.log
  <a href="https://i.stack.imgur.com/X2kcg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X2kcg.png" alt="console.log"></a></p>