title: How to append the new line character in php json response
body: <p>I need to append the new line character in jsonencode .</p>
  
  <p>My string :- </p>
  
  <pre><code>    $event_details ='';
         foreach($res as $k=&gt;$val){ 
           $event_details  .= "{title:'".$val['event_name']."',";
           $event_details  .= "start:'".$val['start_date']."',";
           $event_details  .= "description:'".$val['event_detail']."'," ;
           $event_details  .= "url:'".$val['event_detail']."'," ;
           $event_details  .= "}," ;
         }
  
         Now I got  output Like is  
  {title:'venuer request event 29-08-2015',start:'2015-09-02',description:'venuer request event
   29-08-2015',url:'venuer request event 29-08-2015',},{title:'test event2',start:'2015-08-31',description:'test events1',url:'test events1', },{title:'venuer request event2',start:'2015-08-31',description:'venuer request event2',url:'venuer request event2',},{title
  :'singer request event2',start:'2015-08-31',description:'singer request event2',url:'singer
   request event2',}
  </code></pre>
  
  <p>But I need output like this :</p>
  
  <pre><code>   events: [
          {
              title: 'Event1',
              start: '2015-08-04',
              description :'sample',
              url :'http://localhost.com/melodic_svn/singer/soniya-42',
  
          },
          {
              title: 'Event2',
              start: '2015-08-25',
              description :'sample1',
              url :'http://localhost.com/melodic_svn/singer/soniya-42'
          }
  
      ],
  </code></pre>