
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
@+