title: Print single entry match from array with php csv
body: <p>I have the following code which I am trying to compare a title in a csv file &amp; pull back the appropriate price (in the csv) depending on the title:</p>
  
  <pre><code>&lt;a class="Title" href="&lt;?php echo $item-&gt;link;?&gt;"&gt;
     &lt;?php echo $item-&gt;title;?&gt; &lt;!--country title--&gt;
  &lt;/a&gt;
  &lt;?php
         $pricelist = array();
         if (($handle = fopen("townprices.csv", "r")) !== FALSE)
         {
            while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
            {
               $pricelist[] = $data;
            }
            fclose($handle);
         }
         echo '&lt;pre&gt;'; print_r($pricelist); echo '&lt;/pre&gt;';
  ?&gt;
  </code></pre>
  
  <p>CSV contents:</p>
  
  <pre><code>Spain, 250
  France, 350
  Germany, 150
  </code></pre>
  
  <p>(town/title, price)</p>
  
  <p>This bring back the following array from my csv:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; Spain
              [1] =&gt;  250
          )
      [1] =&gt; Array
          (
              [0] =&gt; France
              [1] =&gt;  350
          )
      [2] =&gt; Array
          (
              [0] =&gt; Germany
              [1] =&gt;  150
          )
  )
  </code></pre>
  
  <p>What I now need to do is just echo the right price, rather than </p>
  
  <pre><code>echo '&lt;pre&gt;'; print_r($pricelist); echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>So I need to create an if statement, something like:</p>
  
  <p>if $item->title = Spain, print 250</p>
  
  <p>But I am stuck on how to do this.
  Any help would be appreciated.
  Thanks</p>