title: go through string laravel and get values
body: <p>I have string like this:</p>
  
  <pre><code> $filters= {"DestinationZone":"","date":"2019-12-13","PolicyName":"","CloseReason":"","ApplicationName":"","level":"","Host":""}
  </code></pre>
  
  <p>I want to go through this string and divide it   to key and value<br>
  I tried a lot but I don't know why it does not want to work.
  this is the code which I tried</p>
  
  <pre><code>   $filters=str_replace('{','', $filters);
    $filters=str_replace('}','', $filters);
   $filters=explode(',',$filters);    
    for($i=0;$i&lt;count($filters);$i++){
  $xx=explode(':',$filters[$i]);
  var_dump($xx);
  foreach ($xx as $xx) 
  {  $value=trim($xx,'"');
  var_dump($value);
   // $key=trim($key,'"');
  
  if (!empty($value)) {
  
   //$query-&gt;where("$key", '=', "$value");
  }
   }
  
    }
  </code></pre>
  
  <p>I think this code is very mess , I am using laravel </p>