I have a JSON archive and I want find and delete one object.
How to find and delete object in a JSON archive?
Example:
{
"themes":[
{"name":"pepito",
"thumbnail":"http://nakome.16mb.com/samples/html/admin/",
"description":"Simple"},
// Delete this in php ---------
{"name":"juanito",
"thumbnail":"http://nakome.16mb.com/samples/html/admin/",
"description":"Simple" }
// ----------------------------
]
}
Without having to write your own parser (and given it’s php) use
json_decodeand turn it in to an object you want to work with, useunsetthen re-json_encodethe result.That would be the easiest way without having to perform string parsing/searches.