title: Encoding the compressed data into json string
body: <p>I am compressing the array as below,</p>
  
  <pre><code>&lt;?php
      $input = array('name'=&gt;'PHP');
      $compressed = gzcompress(serialize($input));
  
      echo '&lt;pre&gt;'; print_r($compressed);
  ?&gt;
  </code></pre>
  
  <p>And it is printing the data as below</p>
  
  <pre><code>xœK´2´ª.¶2±RÊKÌMU².¶2¶R
  ðP²®nJ»
  </code></pre>
  
  <p>Now, I would like to convert <code>$compressed</code> as a json string. Since the compressed data contains special characters, it throws error, So I tried <code>JSON_UNESCAPED_UNICODE</code> below is the code snippet.</p>
  
  <pre><code>&lt;?php
      // $compressed value getting from above script
      echo json_encode($compressed,JSON_UNESCAPED_UNICODE);
  ?&gt;
  </code></pre>
  
  <p>Still it is not working. Can anyone suggest how to encode a compressed data as a json string.</p>