I have following json pattern
{"property":[{"id":"1","name":"Property 1"},{"id":"2","name":"Property 2"}]}
How can i validate json schema? Thanks in advance.
I have following json pattern
{"property":[{"id":"1","name":"Property 1"},{"id":"2","name":"Property 2"}]}
How can i validate json schema? Thanks in advance.
Use json_decode($string);
to convert the JSON string into native PHP. If NULL
is returned the string cannot be decoded. You can then use json_last_error()
to get the error code, which may be helpful.