get the percentage of similarity of two arrays in php
<p>I need to take two arrays and come up with a percent of similarity.  ie:</p>

<pre><code>array( 0=&gt;'1' , 1=&gt;'2' , 2=&gt;'6' , 3=&gt;array(0=&gt;1))
</code></pre>

<p>vers</p>

<pre><code>array( 0=&gt;'1' , 1=&gt;'45' , 2=&gt;'6' , 3=&gt;array(0=&gt;1))
</code></pre>

<p>Where I would think that the % is 75</p>

<p>or </p>

<pre><code>array( 0=&gt;'1' , 1=&gt;'2' , 2=&gt;'6' , 3=&gt;array(0=&gt;'1'))
</code></pre>

<p>vers</p>

<pre><code>array( 0=&gt;'1' , 1=&gt;'2' , 2=&gt;'6' , 3=&gt;array(0=&gt;'55'))
</code></pre>

<p>Not sure how to approach this.. just need to end up with a workable float percent.  Thank you .</p>
