title: PHP - compare the structure of two JSON objects
body: <p>I have <strong>two JSON objects</strong> and I would like to <strong>compare their structure</strong>. How can I do it?</p>
  
  <p>Those object are being generated on-the-fly and <strong>depending on dynamic content</strong>.
  Which means that the objects are <strong>always different</strong> but most of the time have the <strong>same structure</strong>. I want to be able to <strong>catch the changes once they occur</strong>.</p>
  
  <p><strong>Example</strong>: These two objects should be considered as <strong>equal</strong>, because both have the <strong>same structure</strong>: index var and tags array.</p>
  
  <pre><code>{
      "index": 0,
      "tags": [
          "abc"
      ]
  }
  {
      "index": 1,
      "tags": [
          "xyz"
      ]
  }
  </code></pre>
  
  <p>Thoughts?</p>