title: Json returns characters
body: <p>When I am trying to echo json in php it returns  <strong>\n \r \t</strong> . How I can remove them?</p>
  
  <p>Here is my code:  </p>
  
  <pre><code>            ob_start();
                  $this-&gt;load-&gt;view('competition/template',$q);
                  $content = ob_get_clean();
                  $data['content'] = $content;
  
               echo json_encode($data);
  </code></pre>
  
  <p>And am getting:</p>
  
  <pre><code>&lt;/table&gt;{"ok":1,"content":"&lt;table&gt;\r\n   &lt;tr&gt;\r\n\t    &lt;td&gt;Competitor name&lt;\/td&gt;\r\n\t    &lt;td&gt;&lt;input type=\"text\" name=\"competitor_name[2]\" \/&gt;&lt;\/td&gt;\r\n   &lt;\/tr&gt;\r\n   &lt;tr&gt;\r\n   &lt;\/tr&gt;\r\n   &lt;tr&gt;\r\n   &lt;\/tr&gt;\r\n   &lt;tr&gt;\r\n   &lt;\/tr&gt;\r\n&lt;\/table&gt;"}
  </code></pre>
  
  <p>This is the template.php file:</p>
  
  <pre><code> &lt;table&gt;
     &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $this-&gt;__('Competitor name');?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="competitor_name[&lt;?php echo $id?&gt;]" /&gt;&lt;/td&gt;
     &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>After str_replace or preg_repalce, am getting:</p>
  
  <pre><code>{"ok":1,"content":"&lt;table&gt;   &lt;tr&gt;    &lt;td&gt;Competitor name&lt;\/td&gt;    &lt;td&gt;&lt;input type=\"text\" name=\"competitor_name[1]\" \/&gt;&lt;\/td&gt;   &lt;\/tr&gt; &lt;\/table&gt;"}
  </code></pre>
  
  <p>Now my problem is  <strong>\.</strong></p>
  
  <p>Thank you.</p>
  
  <p>Ok I found the anwser. Here it is:</p>
  
  <pre><code> $content = preg_replace("@[\\r|\\n|\\t|\\/|\\\"]+@", "", $content);
  </code></pre>
  
  <p>But am not sure why I was getting this problem .</p>