title: How to convert into json object like array
body: <p>Mycode is given below:</p>
  
  <p>// seatsToCancel=U23,L43,U12</p>
  
  <pre><code>      $tin='S4243534';         //Booking id
  
        $seatsToCancel=$_GET['seatsToCancel'];
  
        $seatArray=explode(",",$seatsToCancel);
  
        $seatCount=count($seatArray);
  
        $SeatsTocancel=implode ( '", "', $seatArray );
  
         $params = array(
                                      "tin"=&gt;"$tin",
                                    "seatsToCancel"=&gt;array($SeatsTocancel)
                           );
  
      echo $params=json_encode($params);
  </code></pre>
  
  <p>I want output like this:</p>
  
  <pre><code>{"tin":"S4243534" ,"seatsToCancel":["U23","L43","U12"]}
  </code></pre>