title: Splitting array by comparing keys in PHP
body: <p>I have an array like this;</p>
  
  <pre><code>Array
  (
      [database1.table1.fieldname] =&gt; "test"
      [database1.table1.fieldname1] =&gt; "test1"
      [database2.table2.fieldname] =&gt; "test2"
  )
  </code></pre>
  
  <p>Here for the first two values the <code>database name</code> and <code>table name</code> are the same. Fieldname is not so important here. For the third value the database name and table name are different. What I want to achieve is that I want to split this array in to seperate arrays by comparing the database name and table name. I need to achieve something like this;</p>
  
  <pre><code>Array
  (
      [database1.table1.fieldname] =&gt; "test"
      [database1.table1.fieldname1] =&gt; "test1"
  )
  
  Array
  (
      [database2.table2.fieldname] =&gt; "test2"
  )
  </code></pre>
  
  <p>Is it possible to do something like this?.</p>