PHP Classes

This class does not work !!!

Recommend this page to a friend!

      PHP Ignore JSON Key  >  All threads  >  This class does not work !!!  >  (Un) Subscribe thread alerts  
Subject:This class does not work !!!
Summary:This class does not work !!!
Messages:1
Author:Schinko
Date:2016-09-28 16:51:00
 

  1. This class does not work !!!   Reply   Report abuse  
Picture of Schinko Schinko - 2016-09-28 16:51:00
[code]
<?php
require_once('ignore.php');
$ignore = new Ignore;

$val = '{"description": {"size": {"width": "100","height":"200"}},"format" : {"type":"text"},"type": {"drop1": {"value": "A,B,H,M,Q,R,S,T,X,W,Z"}}}';
$exclude = "description";
echo $ignore->ignore_keys($val, $exclude);
?>
[/code]

result :'{"height":"200"}},"format" : {"type":"text"},"type": {"drop1": {"value": "A,B,H,M,Q,R,S,T,X,W,Z"}}}'

the true result should be: '{"format":{"type":"text"},"type":{"drop1":{"value":"A,B,H,M,Q,R,S,T,X,W,Z"}}}'

Moreover, the resultant string is not a valid JSON string

@+