PHP: searching array
<p>I am getting two arrays</p>

<pre><code>Array
(
    [0] =&gt; 1990
    [1] =&gt; 1991
    [2] =&gt; 1992
    [3] =&gt; 1993
    [4] =&gt; 1994
    [5] =&gt; 1995
    [6] =&gt; 1996
    [7] =&gt; 1997
    [8] =&gt; 1998
    [9] =&gt; 1999
    [10] =&gt; 2000
    [11] =&gt; 2001
    [12] =&gt; 2002
    [13] =&gt; 2003
    [14] =&gt; 2004
    [15] =&gt; 2005
    [16] =&gt; 2006
    [17] =&gt; 2007
    [18] =&gt; 2008
    [19] =&gt; 2009
    [20] =&gt; 2010
    [21] =&gt; 2011
    [22] =&gt; 2012
    [23] =&gt; 2013
)
</code></pre>

<p>and</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [year] =&gt; 2011
            [conv_value] =&gt; 80
        )

    [1] =&gt; Array
        (
            [year] =&gt; 2012
            [conv_value] =&gt; 95
        )

    [2] =&gt; Array
        (
            [year] =&gt; 2004
            [conv_value] =&gt; 60
        )

    [3] =&gt; Array
        (
            [year] =&gt; 2000
            [conv_value] =&gt; 55
        )

)
</code></pre>

<p>and want to find match of year from 2nd array in 1st array and create a new array with length exactly 1st array searching should be like: </p>

<p>If year found then a new index will be set name <strong>conv_value</strong> contain value from 2nd array index <strong>conv_value</strong> and if not found then <strong>conv_value</strong> will be empty.</p>

<p>like this</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [year] =&gt; 1990
            [conv_value] =&gt; 
        )

    [1] =&gt; Array
        (
            [year] =&gt; 1991
            [conv_value] =&gt; 
        )

    [2] =&gt; Array
        (
            [year] =&gt; 1992
            [conv_value] =&gt; 
        )

    [3] =&gt; Array
        (
            [year] =&gt; 1993
            [conv_value] =&gt; 
        )

    [4] =&gt; Array
        (
            [year] =&gt; 1995
            [conv_value] =&gt; 
        )

    [5] =&gt; Array
        (
            [year] =&gt; 1996
            [conv_value] =&gt; 
        )

    [6] =&gt; Array
        (
            [year] =&gt; 1997
            [conv_value] =&gt; 
        )

    [7] =&gt; Array
        (
            [year] =&gt; 1998
            [conv_value] =&gt; 
        )

    [8] =&gt; Array
        (
            [year] =&gt; 1999
            [conv_value] =&gt; 
        )

    [9] =&gt; Array
        (
            [year] =&gt; 2000
            [conv_value] =&gt; 55
        )

    [10] =&gt; Array
        (
            [year] =&gt; 2001
            [conv_value] =&gt; 
        )

    [11] =&gt; Array
        (
            [year] =&gt; 2002
            [conv_value] =&gt; 
        )

    [12] =&gt; Array
        (
            [year] =&gt; 2003
            [conv_value] =&gt; 
        )

    [13] =&gt; Array
        (
            [year] =&gt; 2004
            [conv_value] =&gt; 95
        )

    [14] =&gt; Array
        (
            [year] =&gt; 2005
            [conv_value] =&gt; 
        )

    [15] =&gt; Array
        (
            [year] =&gt; 2006
            [conv_value] =&gt; 
        )

    [16] =&gt; Array
        (
            [year] =&gt; 2007
            [conv_value] =&gt; 
        )

    [17] =&gt; Array
        (
            [year] =&gt; 2008
            [conv_value] =&gt; 
        )

    [18] =&gt; Array
        (
            [year] =&gt; 2009
            [conv_value] =&gt; 
        )

    [19] =&gt; Array
        (
            [year] =&gt; 2010
            [conv_value] =&gt; 
        )
    [20] =&gt; Array
        (
            [year] =&gt; 2011
            [conv_value] =&gt; 80
        )

    [21] =&gt; Array
        (
            [year] =&gt; 2012
            [conv_value] =&gt; 95
        )

    [22] =&gt; Array
        (
            [year] =&gt; 2013
            [conv_value] =&gt; 
        )

    )
</code></pre>

<p>I scripted</p>

<pre><code>for ( $y = 0; $y &lt; sizeof($cc); $y++ ){
    for ( $z = 0; $z &lt; sizeof($years); $z++ ){
        if ($cc[$y]['year'] == $years[$z]) {
            echo 'Hay&lt;br&gt;';
        }else{
            echo 'Nahee hay&lt;br&gt;';
        }
    }
}
</code></pre>

<p>but not got result..</p>

<p>where i m doing mistake.?</p>
